summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/jpeg
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-02 19:23:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-02 19:23:46 +0000
commiteba47f8f0637f451e21348187591e1f1fd58ac74 (patch)
tree448f10b95c656604acc331a3236c1e59bde5c1ad /kfile-plugins/jpeg
parentc7e8736c69373f48b0401319757c742e8607431a (diff)
downloadtdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz
tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfile-plugins/jpeg')
-rw-r--r--kfile-plugins/jpeg/exif.cpp26
-rw-r--r--kfile-plugins/jpeg/exif.h34
-rw-r--r--kfile-plugins/jpeg/kfile_jpeg.cpp126
-rw-r--r--kfile-plugins/jpeg/kfile_jpeg.h12
4 files changed, 99 insertions, 99 deletions
diff --git a/kfile-plugins/jpeg/exif.cpp b/kfile-plugins/jpeg/exif.cpp
index f25e8a78..b6a2f88b 100644
--- a/kfile-plugins/jpeg/exif.cpp
+++ b/kfile-plugins/jpeg/exif.cpp
@@ -9,7 +9,7 @@
#include "exif.h"
-#include <qwmatrix.h>
+#include <tqwmatrix.h>
#include <kglobal.h>
@@ -214,7 +214,7 @@ static int BytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8};
//--------------------------------------------------------------------------
// Parse the marker stream until SOS or EOI is seen;
//--------------------------------------------------------------------------
-int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
+int ExifData::ReadJpegSections (TQFile & infile, ReadMode_t ReadMode)
{
int a;
@@ -525,11 +525,11 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
switch(Tag){
case TAG_MAKE:
- ExifData::CameraMake = QString::fromLatin1((const char*)ValuePtr, 31);
+ ExifData::CameraMake = TQString::fromLatin1((const char*)ValuePtr, 31);
break;
case TAG_MODEL:
- ExifData::CameraModel = QString::fromLatin1((const char*)ValuePtr, 39);
+ ExifData::CameraModel = TQString::fromLatin1((const char*)ValuePtr, 39);
break;
case TAG_ORIENTATION:
@@ -537,7 +537,7 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
break;
case TAG_DATETIME_ORIGINAL:
- DateTime = QString::fromLatin1((const char*)ValuePtr, 19);
+ DateTime = TQString::fromLatin1((const char*)ValuePtr, 19);
break;
case TAG_USERCOMMENT:
@@ -558,12 +558,12 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
int c;
c = (ValuePtr)[a];
if (c != '\0' && c != ' '){
- UserComment = QString::fromLatin1((const char*)(a+ValuePtr), 199);
+ UserComment = TQString::fromLatin1((const char*)(a+ValuePtr), 199);
break;
}
}
}else{
- UserComment = QString::fromLatin1((const char*)ValuePtr, 199);
+ UserComment = TQString::fromLatin1((const char*)ValuePtr, 199);
}
break;
@@ -740,7 +740,7 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
//--------------------------------------------------------------------------
void ExifData::process_COM (const uchar * Data, int length)
{
- Comment = QString::fromUtf8((char *)Data+2, (length-2));
+ Comment = TQString::fromUtf8((char *)Data+2, (length-2));
}
@@ -880,11 +880,11 @@ ExifData::ExifData()
//--------------------------------------------------------------------------
// process a EXIF jpeg file
//--------------------------------------------------------------------------
-bool ExifData::scan(const QString & path)
+bool ExifData::scan(const TQString & path)
{
int ret;
- QFile f(path);
+ TQFile f(path);
if ( !f.open(IO_ReadOnly) )
return false;
@@ -940,13 +940,13 @@ bool ExifData::isThumbnailSane() {
// return a thumbnail that respects the orientation flag
// only if it seems sane
//--------------------------------------------------------------------------
-QImage ExifData::getThumbnail() {
+TQImage ExifData::getThumbnail() {
if (!isThumbnailSane()) return NULL;
if (!Orientation || Orientation == 1) return Thumbnail;
// now fix orientation
- QWMatrix M;
- QWMatrix flip= QWMatrix(-1,0,0,1,0,0);
+ TQWMatrix M;
+ TQWMatrix flip= TQWMatrix(-1,0,0,1,0,0);
switch (Orientation) { // notice intentional fallthroughs
case 2: M = flip; break;
case 4: M = flip;
diff --git a/kfile-plugins/jpeg/exif.h b/kfile-plugins/jpeg/exif.h
index 2b4e5606..f8eb13ef 100644
--- a/kfile-plugins/jpeg/exif.h
+++ b/kfile-plugins/jpeg/exif.h
@@ -10,9 +10,9 @@
#include <math.h>
#include <time.h>
-#include "qstring.h"
-#include "qfile.h"
-#include "qimage.h"
+#include "tqstring.h"
+#include "tqfile.h"
+#include "tqimage.h"
#include <kdebug.h>
typedef enum {
@@ -42,9 +42,9 @@ typedef struct {
class ExifData {
Section_t Sections[MAX_SECTIONS];
- QString CameraMake;
- QString CameraModel;
- QString DateTime;
+ TQString CameraMake;
+ TQString CameraModel;
+ TQString DateTime;
int Orientation;
int Height, Width;
int ExifImageLength, ExifImageWidth;
@@ -62,11 +62,11 @@ class ExifData {
int ExposureProgram;
int ISOequivalent;
int CompressionLevel;
- QString UserComment;
- QString Comment;
- QImage Thumbnail;
+ TQString UserComment;
+ TQString Comment;
+ TQImage Thumbnail;
- int ReadJpegSections (QFile & infile, ReadMode_t ReadMode);
+ int ReadJpegSections (TQFile & infile, ReadMode_t ReadMode);
void DiscardData(void);
int Get16u(void * Short);
int Get32s(void * Long);
@@ -82,10 +82,10 @@ class ExifData {
public:
ExifData();
- bool scan(const QString &);
- QString getCameraMake() { return CameraMake; }
- QString getCameraModel() { return CameraModel; }
- QString getDateTime() { return DateTime; }
+ bool scan(const TQString &);
+ TQString getCameraMake() { return CameraMake; }
+ TQString getCameraModel() { return CameraModel; }
+ TQString getDateTime() { return DateTime; }
int getOrientation() { return Orientation; }
int getHeight() { return Height; }
int getWidth() { return Width; }
@@ -103,9 +103,9 @@ public:
int getExposureProgram() { return ExposureProgram; }
int getISOequivalent() { return ISOequivalent; }
int getCompressionLevel() { return CompressionLevel; }
- QString getUserComment() { return UserComment; }
- QString getComment() { return Comment; }
- QImage getThumbnail();
+ TQString getUserComment() { return UserComment; }
+ TQString getComment() { return Comment; }
+ TQImage getThumbnail();
bool isThumbnailSane();
bool isNullThumbnail() { return !isThumbnailSane(); }
};
diff --git a/kfile-plugins/jpeg/kfile_jpeg.cpp b/kfile-plugins/jpeg/kfile_jpeg.cpp
index d302cf65..5c7e8076 100644
--- a/kfile-plugins/jpeg/kfile_jpeg.cpp
+++ b/kfile-plugins/jpeg/kfile_jpeg.cpp
@@ -29,12 +29,12 @@
#include <kgenericfactory.h>
#include <kdebug.h>
-#include <qcstring.h>
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qdict.h>
-#include <qvalidator.h>
-#include <qimage.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqdict.h>
+#include <tqvalidator.h>
+#include <tqimage.h>
#include "exif.h"
@@ -44,8 +44,8 @@ typedef KGenericFactory<KJpegPlugin> JpegFactory;
K_EXPORT_COMPONENT_FACTORY(kfile_jpeg, JpegFactory("kfile_jpeg"))
-KJpegPlugin::KJpegPlugin(QObject *parent, const char *name,
- const QStringList &args )
+KJpegPlugin::KJpegPlugin(TQObject *parent, const char *name,
+ const TQStringList &args )
: KFilePlugin(parent, name, args)
{
kdDebug(7034) << "jpeg plugin\n";
@@ -58,110 +58,110 @@ KJpegPlugin::KJpegPlugin(QObject *parent, const char *name,
i18n("JPEG Exif") );
KFileMimeTypeInfo::ItemInfo* item;
- item = addItemInfo( exifGroup, "Comment", i18n("Comment"), QVariant::String);
+ item = addItemInfo( exifGroup, "Comment", i18n("Comment"), TQVariant::String);
setAttributes( item,
KFileMimeTypeInfo::Modifiable |
KFileMimeTypeInfo::Addable |
KFileMimeTypeInfo::MultiLine );
item = addItemInfo( exifGroup, "Manufacturer", i18n("Camera Manufacturer"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Model", i18n("Camera Model"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Date/time", i18n("Date/Time"),
- QVariant::DateTime );
+ TQVariant::DateTime );
item = addItemInfo( exifGroup, "CreationDate", i18n("Creation Date"),
- QVariant::Date );
+ TQVariant::Date );
item = addItemInfo( exifGroup, "CreationTime", i18n("Creation Time"),
- QVariant::Time );
+ TQVariant::Time );
item = addItemInfo( exifGroup, "Dimensions", i18n("Dimensions"),
- QVariant::Size );
+ TQVariant::Size );
setHint( item, KFileMimeTypeInfo::Size );
setUnit( item, KFileMimeTypeInfo::Pixels );
item = addItemInfo( exifGroup, "Orientation", i18n("Orientation"),
- QVariant::Int );
+ TQVariant::Int );
item = addItemInfo( exifGroup, "ColorMode", i18n("Color Mode"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Flash used", i18n("Flash Used"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Focal length", i18n("Focal Length"),
- QVariant::String );
+ TQVariant::String );
setUnit( item, KFileMimeTypeInfo::Millimeters );
item = addItemInfo( exifGroup, "35mm equivalent", i18n("35mm Equivalent"),
- QVariant::Int );
+ TQVariant::Int );
setUnit( item, KFileMimeTypeInfo::Millimeters );
item = addItemInfo( exifGroup, "CCD width", i18n("CCD Width"),
- QVariant::String );
+ TQVariant::String );
setUnit( item, KFileMimeTypeInfo::Millimeters );
item = addItemInfo( exifGroup, "Exposure time", i18n("Exposure Time"),
- QVariant::String );
+ TQVariant::String );
setHint( item, KFileMimeTypeInfo::Seconds );
item = addItemInfo( exifGroup, "Aperture", i18n("Aperture"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Focus dist.", i18n("Focus Dist."),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Exposure bias", i18n("Exposure Bias"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Whitebalance", i18n("Whitebalance"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Metering mode", i18n("Metering Mode"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Exposure", i18n("Exposure"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "ISO equiv.", i18n("ISO Equiv."),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "JPEG quality", i18n("JPEG Quality"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "User comment", i18n("User Comment"),
- QVariant::String );
+ TQVariant::String );
setHint(item, KFileMimeTypeInfo::Description);
item = addItemInfo( exifGroup, "JPEG process", i18n("JPEG Process"),
- QVariant::String );
+ TQVariant::String );
item = addItemInfo( exifGroup, "Thumbnail", i18n("Thumbnail"),
- QVariant::Image );
+ TQVariant::Image );
setHint( item, KFileMimeTypeInfo::Thumbnail );
// ###
// exifGroup.setSupportsVariableKeys(true);
}
-QValidator* KJpegPlugin::createValidator(const KFileMetaInfoItem& /*item*/,
- QObject */*parent*/,
+TQValidator* KJpegPlugin::createValidator(const KFileMetaInfoItem& /*item*/,
+ TQObject */*parent*/,
const char */*name*/ ) const
{
// no need to return a validator that validates everything as OK :)
// if (item.isEditable())
-// return new QRegExpValidator(QRegExp(".*"), parent, name);
+// return new TQRegExpValidator(TQRegExp(".*"), parent, name);
// else
return 0L;
}
bool KJpegPlugin::writeInfo( const KFileMetaInfo& info ) const
{
- QString comment = info[EXIFGROUP].value("Comment").toString();
- QString path = info.path();
+ TQString comment = info[EXIFGROUP].value("Comment").toString();
+ TQString path = info.path();
kdDebug(7034) << "exif writeInfo: " << info.path() << " \"" << comment << "\"\n";
@@ -182,7 +182,7 @@ bool KJpegPlugin::writeInfo( const KFileMetaInfo& info ) const
which is fully backwards compatible with readers expecting ascii.
Readers expecting a national character set are out of luck...
*/
- if( safe_copy_and_modify( QFile::encodeName( path ), comment.utf8() ) ) {
+ if( safe_copy_and_modify( TQFile::encodeName( path ), comment.utf8() ) ) {
return false;
}
return true;
@@ -190,11 +190,11 @@ bool KJpegPlugin::writeInfo( const KFileMetaInfo& info ) const
bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
{
- const QString path( info.path() );
+ const TQString path( info.path() );
if ( path.isEmpty() ) // remote file
return false;
- QString tag;
+ TQString tag;
ExifData ImageInfo;
// parse the jpeg file now
@@ -230,7 +230,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
tag = ImageInfo.getDateTime();
if (tag.length()){
- QDateTime dt = parseDateTime( tag.stripWhiteSpace() );
+ TQDateTime dt = parseDateTime( tag.stripWhiteSpace() );
if ( dt.isValid() ) {
appendItem( exifGroup, "Date/time", dt );
appendItem( exifGroup, "CreationDate", dt.date() );
@@ -238,7 +238,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
}
}
- appendItem( exifGroup,"Dimensions", QSize( ImageInfo.getWidth(),
+ appendItem( exifGroup,"Dimensions", TQSize( ImageInfo.getWidth(),
ImageInfo.getHeight() ) );
if ( ImageInfo.getOrientation() )
@@ -249,7 +249,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
int flashUsed = ImageInfo.getFlashUsed(); // -1, <set>
if ( flashUsed >= 0 ) {
- QString flash = i18n("Flash", "(unknown)");
+ TQString flash = i18n("Flash", "(unknown)");
switch ( flashUsed ) {
case 0: flash = i18n("Flash", "No");
break;
@@ -286,7 +286,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
if (ImageInfo.getFocalLength()){
appendItem( exifGroup, "Focal length",
- QString().sprintf("%4.1f", ImageInfo.getFocalLength()) );
+ TQString().sprintf("%4.1f", ImageInfo.getFocalLength()) );
if (ImageInfo.getCCDWidth()){
appendItem( exifGroup, "35mm equivalent",
@@ -296,21 +296,21 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
if (ImageInfo.getCCDWidth()){
appendItem( exifGroup, "CCD width",
- QString().sprintf("%4.2f", ImageInfo.getCCDWidth()) );
+ TQString().sprintf("%4.2f", ImageInfo.getCCDWidth()) );
}
if (ImageInfo.getExposureTime()){
- tag=QString().sprintf("%6.3f", ImageInfo.getExposureTime());
+ tag=TQString().sprintf("%6.3f", ImageInfo.getExposureTime());
float exposureTime = ImageInfo.getExposureTime();
if (exposureTime > 0 && exposureTime <= 0.5){
- tag+=QString().sprintf(" (1/%d)", (int)(0.5 + 1/exposureTime) );
+ tag+=TQString().sprintf(" (1/%d)", (int)(0.5 + 1/exposureTime) );
}
appendItem( exifGroup, "Exposure time", tag );
}
if (ImageInfo.getApertureFNumber()){
appendItem( exifGroup, "Aperture",
- QString().sprintf("f/%3.1f",
+ TQString().sprintf("f/%3.1f",
(double)ImageInfo.getApertureFNumber()));
}
@@ -318,14 +318,14 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
if (ImageInfo.getDistance() < 0){
tag=i18n("Infinite");
}else{
- tag=QString().sprintf("%5.2fm",(double)ImageInfo.getDistance());
+ tag=TQString().sprintf("%5.2fm",(double)ImageInfo.getDistance());
}
appendItem( exifGroup, "Focus dist.", tag );
}
if (ImageInfo.getExposureBias()){
appendItem( exifGroup, "Exposure bias",
- QString().sprintf("%4.2f",
+ TQString().sprintf("%4.2f",
(double)ImageInfo.getExposureBias()) );
}
@@ -443,7 +443,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
if (ImageInfo.getISOequivalent()){
appendItem( exifGroup, "ISO equiv.",
- QString().sprintf("%2d",
+ TQString().sprintf("%2d",
(int)ImageInfo.getISOequivalent()) );
}
@@ -473,7 +473,7 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
for (a=0;;a++){
if (ProcessTable[a].Tag == ImageInfo.getProcess() || ProcessTable[a].Tag == 0){
appendItem( exifGroup, "JPEG process",
- QString::fromUtf8( ProcessTable[a].Desc) );
+ TQString::fromUtf8( ProcessTable[a].Desc) );
break;
}
}
@@ -487,18 +487,18 @@ bool KJpegPlugin::readInfo( KFileMetaInfo& info, uint what )
// format of the string is:
// YYYY:MM:DD HH:MM:SS
-QDateTime KJpegPlugin::parseDateTime( const QString& string )
+TQDateTime KJpegPlugin::parseDateTime( const TQString& string )
{
- QDateTime dt;
+ TQDateTime dt;
if ( string.length() != 19 )
return dt;
- QString year = string.left( 4 );
- QString month = string.mid( 5, 2 );
- QString day = string.mid( 8, 2 );
- QString hour = string.mid( 11, 2 );
- QString minute = string.mid( 14, 2 );
- QString seconds = string.mid( 17, 2 );
+ TQString year = string.left( 4 );
+ TQString month = string.mid( 5, 2 );
+ TQString day = string.mid( 8, 2 );
+ TQString hour = string.mid( 11, 2 );
+ TQString minute = string.mid( 14, 2 );
+ TQString seconds = string.mid( 17, 2 );
bool ok;
bool allOk = true;
@@ -521,8 +521,8 @@ QDateTime KJpegPlugin::parseDateTime( const QString& string )
allOk &= ok;
if ( allOk ) {
- dt.setDate( QDate( y, mo, d ) );
- dt.setTime( QTime( h, mi, s ) );
+ dt.setDate( TQDate( y, mo, d ) );
+ dt.setTime( TQTime( h, mi, s ) );
}
return dt;
diff --git a/kfile-plugins/jpeg/kfile_jpeg.h b/kfile-plugins/jpeg/kfile_jpeg.h
index 5c585fb0..70c14501 100644
--- a/kfile-plugins/jpeg/kfile_jpeg.h
+++ b/kfile-plugins/jpeg/kfile_jpeg.h
@@ -20,7 +20,7 @@
#ifndef __KFILE_JPEG_H__
#define __KFILE_JPEG_H__
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <kfilemetainfo.h>
class KJpegPlugin: public KFilePlugin
@@ -28,16 +28,16 @@ class KJpegPlugin: public KFilePlugin
Q_OBJECT
public:
- KJpegPlugin( QObject *parent, const char *name,
- const QStringList& args );
+ KJpegPlugin( TQObject *parent, const char *name,
+ const TQStringList& args );
virtual bool readInfo ( KFileMetaInfo& info, uint what );
virtual bool writeInfo( const KFileMetaInfo& info ) const;
- virtual QValidator* createValidator( const KFileMetaInfoItem& item,
- QObject* parent, const char* name) const;
+ virtual TQValidator* createValidator( const KFileMetaInfoItem& item,
+ TQObject* parent, const char* name) const;
private:
- QDateTime parseDateTime( const QString& string );
+ TQDateTime parseDateTime( const TQString& string );
};
#endif