summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 19:10:16 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 19:10:16 +0000
commit9537154bbf389a6ae5ccbff822ffcc3a5269a93c (patch)
treeee48f82d9cf68953e72eb9e184d9740a09c7be0b
parent84d52ca1330afb56da0faa2d2c60f031f41b43e9 (diff)
downloadlibkexiv2-9537154b.tar.gz
libkexiv2-9537154b.zip
TQt4 port libkexiv2
This enables compilation under Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/libkexiv2@1232461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--libkexiv2/libkexiv2/kexiv2.cpp458
-rw-r--r--libkexiv2/libkexiv2/kexiv2.h146
-rw-r--r--libkexiv2/libkexiv2/kexiv2private.cpp42
-rw-r--r--libkexiv2/libkexiv2/kexiv2private.h24
4 files changed, 335 insertions, 335 deletions
diff --git a/libkexiv2/libkexiv2/kexiv2.cpp b/libkexiv2/libkexiv2/kexiv2.cpp
index 8116342..8fff593 100644
--- a/libkexiv2/libkexiv2/kexiv2.cpp
+++ b/libkexiv2/libkexiv2/kexiv2.cpp
@@ -33,15 +33,15 @@ extern "C"
#include <utime.h>
}
-// Qt includes.
+// TQt includes.
-#include <qfile.h>
-#include <qimage.h>
-#include <qsize.h>
-#include <qtextcodec.h>
-#include <qwmatrix.h>
-#include <qfileinfo.h>
-#include <qbuffer.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqsize.h>
+#include <tqtextcodec.h>
+#include <tqwmatrix.h>
+#include <tqfileinfo.h>
+#include <tqbuffer.h>
// Local includes.
@@ -57,7 +57,7 @@ KExiv2::KExiv2()
d = new KExiv2Priv;
}
-KExiv2::KExiv2(const QString& filePath)
+KExiv2::KExiv2(const TQString& filePath)
{
d = new KExiv2Priv;
load(filePath);
@@ -68,13 +68,13 @@ KExiv2::~KExiv2()
delete d;
}
-bool KExiv2::supportMetadataWritting(const QString& typeMime)
+bool KExiv2::supportMetadataWritting(const TQString& typeMime)
{
- if (typeMime == QString("image/jpeg"))
+ if (typeMime == TQString("image/jpeg"))
{
return true;
}
- else if (typeMime == QString("image/tiff"))
+ else if (typeMime == TQString("image/tiff"))
{
#if (EXIV2_TEST_VERSION(0,17,91))
return true;
@@ -82,7 +82,7 @@ bool KExiv2::supportMetadataWritting(const QString& typeMime)
return false;
#endif
}
- else if (typeMime == QString("image/png"))
+ else if (typeMime == TQString("image/png"))
{
#if (EXIV2_TEST_VERSION(0,17,91))
return true;
@@ -90,7 +90,7 @@ bool KExiv2::supportMetadataWritting(const QString& typeMime)
return false;
#endif
}
- else if (typeMime == QString("image/jp2"))
+ else if (typeMime == TQString("image/jp2"))
{
#if (EXIV2_TEST_VERSION(0,17,91))
return true;
@@ -102,28 +102,28 @@ bool KExiv2::supportMetadataWritting(const QString& typeMime)
return false;
}
-QString KExiv2::version()
+TQString KExiv2::version()
{
- return QString( kexiv2_version );
+ return TQString( kexiv2_version );
}
-QString KExiv2::Exiv2Version()
+TQString KExiv2::Exiv2Version()
{
// Since 0.14.0 release, we can extract run-time version of Exiv2.
// else we return make version.
#if (EXIV2_TEST_VERSION(0,14,0))
- return QString(Exiv2::version());
+ return TQString(Exiv2::version());
#else
- return QString("%1.%2.%3").arg(EXIV2_MAJOR_VERSION)
- .arg(EXIV2_MINOR_VERSION)
- .arg(EXIV2_PATCH_VERSION);
+ return TQString("%1.%2.%3").tqarg(EXIV2_MAJOR_VERSION)
+ .tqarg(EXIV2_MINOR_VERSION)
+ .tqarg(EXIV2_PATCH_VERSION);
#endif
}
bool KExiv2::clearComments()
{
- return setComments(QByteArray());
+ return setComments(TQByteArray());
}
bool KExiv2::clearExif()
@@ -156,22 +156,22 @@ bool KExiv2::clearIptc()
return false;
}
-QString KExiv2::getFilePath() const
+TQString KExiv2::getFilePath() const
{
return d->filePath;
}
-QByteArray KExiv2::getComments() const
+TQByteArray KExiv2::getComments() const
{
- return QByteArray().duplicate(d->imageComments.data(), d->imageComments.size());
+ return TQByteArray().duplicate(d->imageComments.data(), d->imageComments.size());
}
-QString KExiv2::getCommentsDecoded() const
+TQString KExiv2::getCommentsDecoded() const
{
return d->detectEncodingAndDecode(d->imageComments);
}
-QByteArray KExiv2::getExif() const
+TQByteArray KExiv2::getExif() const
{
try
{
@@ -183,12 +183,12 @@ QByteArray KExiv2::getExif() const
#if (EXIV2_TEST_VERSION(0,17,91))
Exiv2::Blob blob;
Exiv2::ExifParser::encode(blob, Exiv2::bigEndian, exif);
- QByteArray ba(blob.size());
+ TQByteArray ba(blob.size());
if (ba.size())
memcpy(ba.data(), (const char*)&blob[0], blob.size());
#else
Exiv2::DataBuf c2 = exif.copy();
- QByteArray ba(c2.size_);
+ TQByteArray ba(c2.size_);
if (ba.size())
memcpy(ba.data(), c2.pData_, c2.size_);
#endif
@@ -204,10 +204,10 @@ QByteArray KExiv2::getExif() const
d->printExiv2ExceptionError("Cannot get Exif data using Exiv2 ", e);
}
- return QByteArray();
+ return TQByteArray();
}
-QByteArray KExiv2::getIptc(bool addIrbHeader) const
+TQByteArray KExiv2::getIptc(bool addIrbHeader) const
{
try
{
@@ -222,7 +222,7 @@ QByteArray KExiv2::getIptc(bool addIrbHeader) const
c2 = Exiv2::Photoshop::setIptcIrb(0, 0, iptc);
#else
qDebug("Exiv2 version is to old. Cannot add Irb header to IPTC metadata");
- return QByteArray();
+ return TQByteArray();
#endif
}
else
@@ -234,7 +234,7 @@ QByteArray KExiv2::getIptc(bool addIrbHeader) const
#endif
}
- QByteArray data(c2.size_);
+ TQByteArray data(c2.size_);
if (data.size())
memcpy(data.data(), c2.pData_, c2.size_);
return data;
@@ -248,16 +248,16 @@ QByteArray KExiv2::getIptc(bool addIrbHeader) const
d->printExiv2ExceptionError("Cannot get Iptc data using Exiv2 ",e);
}
- return QByteArray();
+ return TQByteArray();
}
-bool KExiv2::setComments(const QByteArray& data)
+bool KExiv2::setComments(const TQByteArray& data)
{
d->imageComments = std::string(data.data(), data.size());
return true;
}
-bool KExiv2::setExif(const QByteArray& data)
+bool KExiv2::setExif(const TQByteArray& data)
{
try
{
@@ -285,7 +285,7 @@ bool KExiv2::setExif(const QByteArray& data)
return false;
}
-bool KExiv2::setIptc(const QByteArray& data)
+bool KExiv2::setIptc(const TQByteArray& data)
{
try
{
@@ -313,7 +313,7 @@ bool KExiv2::setIptc(const QByteArray& data)
return false;
}
-bool KExiv2::load(const QByteArray& imgData)
+bool KExiv2::load(const TQByteArray& imgData)
{
if (imgData.isEmpty())
return false;
@@ -322,7 +322,7 @@ bool KExiv2::load(const QByteArray& imgData)
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((Exiv2::byte*)imgData.data(), imgData.size());
- d->filePath = QString();
+ d->filePath = TQString();
image->readMetadata();
// Image comments ---------------------------------
@@ -347,9 +347,9 @@ bool KExiv2::load(const QByteArray& imgData)
return false;
}
-bool KExiv2::load(const QString& filePath)
+bool KExiv2::load(const TQString& filePath)
{
- QFileInfo finfo(filePath);
+ TQFileInfo finfo(filePath);
if (filePath.isEmpty() || !finfo.isReadable())
{
qDebug("File '%s' is not readable.", finfo.fileName().ascii());
@@ -360,7 +360,7 @@ bool KExiv2::load(const QString& filePath)
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
- (QFile::encodeName(filePath)));
+ (TQFile::encodeName(filePath)));
d->filePath = filePath;
image->readMetadata();
@@ -386,14 +386,14 @@ bool KExiv2::load(const QString& filePath)
return false;
}
-bool KExiv2::save(const QString& filePath)
+bool KExiv2::save(const TQString& filePath)
{
if (filePath.isEmpty())
return false;
// NOTE: see B.K.O #137770 & #138540 : never touch the file if is read only.
- QFileInfo finfo(filePath);
- QFileInfo dinfo(finfo.dirPath());
+ TQFileInfo finfo(filePath);
+ TQFileInfo dinfo(finfo.dirPath());
if (!finfo.isWritable())
{
qDebug("File '%s' is read-only. Metadata not saved.", finfo.fileName().ascii());
@@ -407,8 +407,8 @@ bool KExiv2::save(const QString& filePath)
// TIFF/EP Raw files based are supported by Exiv2 0.18 as experimental. We will do touch it for the moment.
// Metadata writing is supported in implementation from svn trunk.
- QString rawTiffBased("dng nef pef 3fr arw cr2 dcr erf k25 kdc mos orf raw sr2 srf");
- if (rawTiffBased.contains(finfo.extension(false).lower()))
+ TQString rawTiffBased("dng nef pef 3fr arw cr2 dcr erf k25 kdc mos orf raw sr2 srf");
+ if (rawTiffBased.tqcontains(finfo.extension(false).lower()))
{
qDebug("'%s' is TIFF based RAW file and writing mode is disable with this libkexiv2 version. Metadata not saved.",
finfo.fileName().ascii());
@@ -419,7 +419,7 @@ bool KExiv2::save(const QString& filePath)
{
Exiv2::AccessMode mode;
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
- (QFile::encodeName(filePath)));
+ (TQFile::encodeName(filePath)));
// We need to load target file metadata to merge with new one. It's mandatory with TIFF format:
// like all tiff file structure is based on Exif.
@@ -444,7 +444,7 @@ bool KExiv2::save(const QString& filePath)
// image data are stored in Exif container. We need to take a care about
// to not lost image data.
Exiv2::ExifData exif = image->exifData();
- QStringList untouchedTags;
+ TQStringList untouchedTags;
untouchedTags << "Exif.Image.ImageWidth";
untouchedTags << "Exif.Image.ImageLength";
untouchedTags << "Exif.Image.BitsPerSample";
@@ -462,7 +462,7 @@ bool KExiv2::save(const QString& filePath)
for (Exiv2::ExifData::iterator it = d->exifMetadata.begin(); it != d->exifMetadata.end(); ++it)
{
- if (!untouchedTags.contains(it->key().c_str()))
+ if (!untouchedTags.tqcontains(it->key().c_str()))
{
exif[it->key().c_str()] = d->exifMetadata[it->key().c_str()];
}
@@ -486,7 +486,7 @@ bool KExiv2::save(const QString& filePath)
// NOTE: Don't touch access and modification timestamp of file.
struct stat st;
- ::stat(QFile::encodeName(filePath), &st);
+ ::stat(TQFile::encodeName(filePath), &st);
struct utimbuf ut;
ut.modtime = st.st_mtime;
@@ -494,7 +494,7 @@ bool KExiv2::save(const QString& filePath)
image->writeMetadata();
- ::utime(QFile::encodeName(filePath), &ut);
+ ::utime(TQFile::encodeName(filePath), &ut);
return true;
}
@@ -514,7 +514,7 @@ bool KExiv2::applyChanges()
return save(d->filePath);
}
-bool KExiv2::isReadOnly(const QString& filePath)
+bool KExiv2::isReadOnly(const TQString& filePath)
{
if (!canWriteComment(filePath))
return true;
@@ -528,12 +528,12 @@ bool KExiv2::isReadOnly(const QString& filePath)
return false;
}
-bool KExiv2::canWriteComment(const QString& filePath)
+bool KExiv2::canWriteComment(const TQString& filePath)
{
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
- (QFile::encodeName(filePath)));
+ (TQFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdComment);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
@@ -547,12 +547,12 @@ bool KExiv2::canWriteComment(const QString& filePath)
return false;
}
-bool KExiv2::canWriteExif(const QString& filePath)
+bool KExiv2::canWriteExif(const TQString& filePath)
{
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
- (QFile::encodeName(filePath)));
+ (TQFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdExif);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
@@ -566,12 +566,12 @@ bool KExiv2::canWriteExif(const QString& filePath)
return false;
}
-bool KExiv2::canWriteIptc(const QString& filePath)
+bool KExiv2::canWriteIptc(const TQString& filePath)
{
try
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
- (QFile::encodeName(filePath)));
+ (TQFile::encodeName(filePath)));
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdIptc);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
@@ -585,14 +585,14 @@ bool KExiv2::canWriteIptc(const QString& filePath)
return false;
}
-bool KExiv2::setImageProgramId(const QString& program, const QString& version)
+bool KExiv2::setImageProgramId(const TQString& program, const TQString& version)
{
try
{
// Record program info in Exif.Image.ProcessingSoftware tag (only available with Exiv2 >= 0.14.0).
#if (EXIV2_TEST_VERSION(0,14,0))
- QString software(program);
+ TQString software(program);
software.append("-");
software.append(version);
d->exifMetadata["Exif.Image.ProcessingSoftware"] = software.ascii();
@@ -608,7 +608,7 @@ bool KExiv2::setImageProgramId(const QString& program, const QString& version)
if (it == exifData.end())
{
- QString software(program);
+ TQString software(program);
software.append("-");
software.append(version);
d->exifMetadata["Exif.Image.Software"] = software.ascii();
@@ -629,10 +629,10 @@ bool KExiv2::setImageProgramId(const QString& program, const QString& version)
return false;
}
-QSize KExiv2::getImageDimensions() const
+TQSize KExiv2::getImageDimensions() const
{
if (d->exifMetadata.empty())
- return QSize();
+ return TQSize();
try
{
@@ -654,7 +654,7 @@ QSize KExiv2::getImageDimensions() const
height = it2->toLong();
if (width != -1 && height != -1)
- return QSize(width, height);
+ return TQSize(width, height);
// Try to get Exif.Image tags
@@ -674,17 +674,17 @@ QSize KExiv2::getImageDimensions() const
height = it4->toLong();
if (width != -1 && height != -1)
- return QSize(width, height);
+ return TQSize(width, height);
}
catch( Exiv2::Error &e )
{
d->printExiv2ExceptionError("Cannot parse image dimensions tag using Exiv2 ", e);
}
- return QSize();
+ return TQSize();
}
-bool KExiv2::setImageDimensions(const QSize& size, bool setProgramName)
+bool KExiv2::setImageDimensions(const TQSize& size, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
@@ -706,9 +706,9 @@ bool KExiv2::setImageDimensions(const QSize& size, bool setProgramName)
return false;
}
-QImage KExiv2::getExifThumbnail(bool fixOrientation) const
+TQImage KExiv2::getExifThumbnail(bool fixOrientation) const
{
- QImage thumbnail;
+ TQImage thumbnail;
if (d->exifMetadata.empty())
return thumbnail;
@@ -727,14 +727,14 @@ QImage KExiv2::getExifThumbnail(bool fixOrientation) const
{
if (fixOrientation)
{
- Exiv2::ExifKey key("Exif.Thumbnail.Orientation");
+ Exiv2::ExifKey key("Exif.Thumbnail.Qt::Orientation");
Exiv2::ExifData exifData(d->exifMetadata);
Exiv2::ExifData::iterator it = exifData.findKey(key);
if (it != exifData.end())
{
- QWMatrix matrix;
+ TQWMatrix matrix;
long orientation = it->toLong();
- qDebug("Exif Thumbnail Orientation: %i", (int)orientation);
+ qDebug("Exif Thumbnail Qt::Orientation: %i", (int)orientation);
switch (orientation)
{
@@ -788,7 +788,7 @@ QImage KExiv2::getExifThumbnail(bool fixOrientation) const
return thumbnail;
}
-bool KExiv2::setExifThumbnail(const QImage& thumb, bool setProgramName)
+bool KExiv2::setExifThumbnail(const TQImage& thumb, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
@@ -796,18 +796,18 @@ bool KExiv2::setExifThumbnail(const QImage& thumb, bool setProgramName)
try
{
#if (EXIV2_TEST_VERSION(0,17,91))
- QByteArray data;
- QBuffer buffer(data);
+ TQByteArray data;
+ TQBuffer buffer(data);
buffer.open(IO_WriteOnly);
thumb.save(&buffer, "JPEG");
Exiv2::ExifThumb thumb(d->exifMetadata);
thumb.setJpegThumbnail((Exiv2::byte *)data.data(), data.size());
#else
- KTempFile thumbFile(QString(), "KExiv2ExifThumbnail");
+ KTempFile thumbFile(TQString(), "KExiv2ExifThumbnail");
thumbFile.setAutoDelete(true);
thumb.save(thumbFile.name(), "JPEG");
- const std::string &fileName( (const char*)(QFile::encodeName(thumbFile.name())) );
+ const std::string &fileName( (const char*)(TQFile::encodeName(thumbFile.name())) );
d->exifMetadata.setJpegThumbnail( fileName );
#endif
return true;
@@ -858,7 +858,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
if (it != exifData.end())
{
orientation = it->toLong();
- qDebug("Minolta Makernote Orientation: %i", (int)orientation);
+ qDebug("Minolta Makernote Qt::Orientation: %i", (int)orientation);
switch(orientation)
{
case 76:
@@ -877,7 +877,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
if (it != exifData.end())
{
orientation = it->toLong();
- qDebug("Minolta Makernote Orientation: %i", (int)orientation);
+ qDebug("Minolta Makernote Qt::Orientation: %i", (int)orientation);
switch(orientation)
{
case 76:
@@ -893,19 +893,19 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
// -- Standard Exif tag --------------------------------
- Exiv2::ExifKey keyStd("Exif.Image.Orientation");
+ Exiv2::ExifKey keyStd("Exif.Image.Qt::Orientation");
it = exifData.findKey(keyStd);
if (it != exifData.end())
{
orientation = it->toLong();
- qDebug("Exif Orientation: %i", (int)orientation);
+ qDebug("Exif Qt::Orientation: %i", (int)orientation);
return (ImageOrientation)orientation;
}
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError("Cannot parse Exif Orientation tag using Exiv2 ", e);
+ d->printExiv2ExceptionError("Cannot parse Exif Qt::Orientation tag using Exiv2 ", e);
}
return ORIENTATION_UNSPECIFIED;
@@ -940,7 +940,7 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
return false;
}
- d->exifMetadata["Exif.Image.Orientation"] = static_cast<uint16_t>(orientation);
+ d->exifMetadata["Exif.Image.Qt::Orientation"] = static_cast<uint16_t>(orientation);
qDebug("Exif orientation tag set to: %i", (int)orientation);
// -- Minolta Cameras ----------------------------------
@@ -973,7 +973,7 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError("Cannot set Exif Orientation tag using Exiv2 ", e);
+ d->printExiv2ExceptionError("Cannot set Exif Qt::Orientation tag using Exiv2 ", e);
}
return false;
@@ -1003,7 +1003,7 @@ KExiv2::ImageColorWorkSpace KExiv2::getImageColorWorkSpace() const
{
// Nikon camera set Exif.Photo.ColorSpace to uncalibrated and
// Exif.Nikon3.ColorMode to "MODE2" when users work in AdobRGB color space.
- if (getExifTagString("Exif.Nikon3.ColorMode").contains("MODE2"))
+ if (getExifTagString("Exif.Nikon3.ColorMode").tqcontains("MODE2"))
return WORKSPACE_ADOBERGB;
// TODO : add more Makernote parsing here ...
@@ -1045,7 +1045,7 @@ bool KExiv2::setImageColorWorkSpace(ImageColorWorkSpace workspace, bool setProgr
return false;
}
-QDateTime KExiv2::getImageDateTime() const
+TQDateTime KExiv2::getImageDateTime() const
{
try
{
@@ -1061,7 +1061,7 @@ QDateTime KExiv2::getImageDateTime() const
if (it2 != exifData.end())
{
- QDateTime dateTime = QDateTime::fromString(it2->toString().c_str(), Qt::ISODate);
+ TQDateTime dateTime = TQDateTime::fromString(it2->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
@@ -1077,7 +1077,7 @@ QDateTime KExiv2::getImageDateTime() const
if (it3 != exifData.end())
{
- QDateTime dateTime = QDateTime::fromString(it3->toString().c_str(), Qt::ISODate);
+ TQDateTime dateTime = TQDateTime::fromString(it3->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
@@ -1093,7 +1093,7 @@ QDateTime KExiv2::getImageDateTime() const
if (it != exifData.end())
{
- QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
+ TQDateTime dateTime = TQDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
@@ -1115,18 +1115,18 @@ QDateTime KExiv2::getImageDateTime() const
if (it != iptcData.end())
{
- QString IptcDateCreated(it->toString().c_str());
+ TQString IptcDateCreated(it->toString().c_str());
Exiv2::IptcKey keyTimeCreated("Iptc.Application2.TimeCreated");
Exiv2::IptcData::iterator it2 = iptcData.findKey(keyTimeCreated);
if (it2 != iptcData.end())
{
- QString IptcTimeCreated(it2->toString().c_str());
+ TQString IptcTimeCreated(it2->toString().c_str());
- QDate date = QDate::fromString(IptcDateCreated, Qt::ISODate);
- QTime time = QTime::fromString(IptcTimeCreated, Qt::ISODate);
- QDateTime dateTime = QDateTime(date, time);
+ TQDate date = TQDate::fromString(IptcDateCreated, Qt::ISODate);
+ TQTime time = TQTime::fromString(IptcTimeCreated, Qt::ISODate);
+ TQDateTime dateTime = TQDateTime(date, time);
if (dateTime.isValid())
{
@@ -1143,18 +1143,18 @@ QDateTime KExiv2::getImageDateTime() const
if (it3 != iptcData.end())
{
- QString IptcDateDigitization(it3->toString().c_str());
+ TQString IptcDateDigitization(it3->toString().c_str());
Exiv2::IptcKey keyDigitizationTime("Iptc.Application2.DigitizationTime");
Exiv2::IptcData::iterator it4 = iptcData.findKey(keyDigitizationTime);
if (it4 != iptcData.end())
{
- QString IptcTimeDigitization(it4->toString().c_str());
+ TQString IptcTimeDigitization(it4->toString().c_str());
- QDate date = QDate::fromString(IptcDateDigitization, Qt::ISODate);
- QTime time = QTime::fromString(IptcTimeDigitization, Qt::ISODate);
- QDateTime dateTime = QDateTime(date, time);
+ TQDate date = TQDate::fromString(IptcDateDigitization, Qt::ISODate);
+ TQTime time = TQTime::fromString(IptcTimeDigitization, Qt::ISODate);
+ TQDateTime dateTime = TQDateTime(date, time);
if (dateTime.isValid())
{
@@ -1170,10 +1170,10 @@ QDateTime KExiv2::getImageDateTime() const
d->printExiv2ExceptionError("Cannot parse Exif date & time tag using Exiv2 ", e);
}
- return QDateTime();
+ return TQDateTime();
}
-bool KExiv2::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitized, bool setProgramName)
+bool KExiv2::setImageDateTime(const TQDateTime& dateTime, bool setDateTimeDigitized, bool setProgramName)
{
if(!dateTime.isValid())
return false;
@@ -1190,7 +1190,7 @@ bool KExiv2::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitiz
// For digital cameras, these dates should be both set, and identical.
// Reference: http://www.exif.org/Exif2-2.PDF, chapter 4.6.5, table 4, section F.
- const std::string &exifdatetime(dateTime.toString(QString("yyyy:MM:dd hh:mm:ss")).ascii());
+ const std::string &exifdatetime(dateTime.toString(TQString("yyyy:MM:dd hh:mm:ss")).ascii());
d->exifMetadata["Exif.Image.DateTime"] = exifdatetime;
d->exifMetadata["Exif.Photo.DateTimeOriginal"] = exifdatetime;
if(setDateTimeDigitized)
@@ -1198,8 +1198,8 @@ bool KExiv2::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitiz
// In Second we write date & time into Iptc.
- const std::string &iptcdate(dateTime.date().toString(Qt::ISODate).ascii());
- const std::string &iptctime(dateTime.time().toString(Qt::ISODate).ascii());
+ const std::string &iptcdate(TQString(dateTime.date().toString(Qt::ISODate)).ascii());
+ const std::string &iptctime(TQString(dateTime.time().toString(Qt::ISODate)).ascii());
d->iptcMetadata["Iptc.Application2.DateCreated"] = iptcdate;
d->iptcMetadata["Iptc.Application2.TimeCreated"] = iptctime;
if(setDateTimeDigitized)
@@ -1218,7 +1218,7 @@ bool KExiv2::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitiz
return false;
}
-bool KExiv2::getImagePreview(QImage& preview) const
+bool KExiv2::getImagePreview(TQImage& preview) const
{
try
{
@@ -1236,15 +1236,15 @@ bool KExiv2::getImagePreview(QImage& preview) const
return false;
}
-bool KExiv2::setImagePreview(const QImage& preview, bool setProgramName)
+bool KExiv2::setImagePreview(const TQImage& preview, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
try
{
- QByteArray data;
- QBuffer buffer(data);
+ TQByteArray data;
+ TQBuffer buffer(data);
buffer.open(IO_WriteOnly);
// A little bit compressed preview jpeg image to limit IPTC size.
@@ -1270,7 +1270,7 @@ bool KExiv2::setImagePreview(const QImage& preview, bool setProgramName)
return false;
}
-QString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
+TQString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
{
try
{
@@ -1282,28 +1282,28 @@ QString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
#if (EXIV2_TEST_VERSION(0,17,91))
// See B.K.O #184156 comment #13
std::string val = it->print(&exifData);
- QString tagValue = QString::fromLocal8Bit(val.c_str());
+ TQString tagValue = TQString::fromLocal8Bit(val.c_str());
#else
std::ostringstream os;
os << *it;
- QString tagValue = QString::fromLocal8Bit(os.str().c_str());
+ TQString tagValue = TQString::fromLocal8Bit(os.str().c_str());
#endif
if (escapeCR)
- tagValue.replace("\n", " ");
+ tagValue.tqreplace("\n", " ");
return tagValue;
}
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Exif key '%1' into image using Exiv2 ")
- .arg(exifTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Exif key '%1' into image using Exiv2 ")
+ .tqarg(exifTagName), e);
}
- return QString();
+ return TQString();
}
-bool KExiv2::setExifTagString(const char *exifTagName, const QString& value, bool setProgramName)
+bool KExiv2::setExifTagString(const char *exifTagName, const TQString& value, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
@@ -1321,7 +1321,7 @@ bool KExiv2::setExifTagString(const char *exifTagName, const QString& value, boo
return false;
}
-QString KExiv2::getIptcTagString(const char* iptcTagName, bool escapeCR) const
+TQString KExiv2::getIptcTagString(const char* iptcTagName, bool escapeCR) const
{
try
{
@@ -1332,24 +1332,24 @@ QString KExiv2::getIptcTagString(const char* iptcTagName, bool escapeCR) const
{
std::ostringstream os;
os << *it;
- QString tagValue = QString::fromLocal8Bit(os.str().c_str());
+ TQString tagValue = TQString::fromLocal8Bit(os.str().c_str());
if (escapeCR)
- tagValue.replace("\n", " ");
+ tagValue.tqreplace("\n", " ");
return tagValue;
}
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Iptc key '%1' into image using Exiv2 ")
- .arg(iptcTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Iptc key '%1' into image using Exiv2 ")
+ .tqarg(iptcTagName), e);
}
- return QString();
+ return TQString();
}
-bool KExiv2::setIptcTagString(const char *iptcTagName, const QString& value, bool setProgramName)
+bool KExiv2::setIptcTagString(const char *iptcTagName, const TQString& value, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
@@ -1382,14 +1382,14 @@ bool KExiv2::getExifTagLong(const char* exifTagName, long &val) const
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Exif key '%1' into image using Exiv2 ")
- .arg(exifTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Exif key '%1' into image using Exiv2 ")
+ .tqarg(exifTagName), e);
}
return false;
}
-QByteArray KExiv2::getExifTagData(const char* exifTagName) const
+TQByteArray KExiv2::getExifTagData(const char* exifTagName) const
{
try
{
@@ -1398,7 +1398,7 @@ QByteArray KExiv2::getExifTagData(const char* exifTagName) const
Exiv2::ExifData::iterator it = exifData.findKey(exifKey);
if (it != exifData.end())
{
- QByteArray data((*it).size());
+ TQByteArray data((*it).size());
if (data.size())
{
#if (EXIV2_TEST_VERSION(0,17,91))
@@ -1412,14 +1412,14 @@ QByteArray KExiv2::getExifTagData(const char* exifTagName) const
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Exif key '%1' into image using Exiv2 ")
- .arg(exifTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Exif key '%1' into image using Exiv2 ")
+ .tqarg(exifTagName), e);
}
- return QByteArray();
+ return TQByteArray();
}
-QByteArray KExiv2::getIptcTagData(const char *iptcTagName) const
+TQByteArray KExiv2::getIptcTagData(const char *iptcTagName) const
{
try
{
@@ -1428,7 +1428,7 @@ QByteArray KExiv2::getIptcTagData(const char *iptcTagName) const
Exiv2::IptcData::iterator it = iptcData.findKey(iptcKey);
if (it != iptcData.end())
{
- QByteArray data((*it).size());
+ TQByteArray data((*it).size());
if (data.size())
(*it).copy((Exiv2::byte*)data.data(), Exiv2::bigEndian);
return data;
@@ -1436,11 +1436,11 @@ QByteArray KExiv2::getIptcTagData(const char *iptcTagName) const
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Iptc key '%1' into image using Exiv2 ")
- .arg(iptcTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Iptc key '%1' into image using Exiv2 ")
+ .tqarg(iptcTagName), e);
}
- return QByteArray();
+ return TQByteArray();
}
bool KExiv2::getExifTagRational(const char *exifTagName, long int &num, long int &den, int component) const
@@ -1459,8 +1459,8 @@ bool KExiv2::getExifTagRational(const char *exifTagName, long int &num, long int
}
catch( Exiv2::Error &e )
{
- d->printExiv2ExceptionError(QString("Cannot find Exif Rational value from key '%1' "
- "into image using Exiv2 ").arg(exifTagName), e);
+ d->printExiv2ExceptionError(TQString("Cannot find Exif Rational value from key '%1' "
+ "into image using Exiv2 ").tqarg(exifTagName), e);
}
return false;
@@ -1502,7 +1502,7 @@ bool KExiv2::setExifTagRational(const char *exifTagName, long int num, long int
return false;
}
-bool KExiv2::setExifTagData(const char *exifTagName, const QByteArray& data, bool setProgramName)
+bool KExiv2::setExifTagData(const char *exifTagName, const TQByteArray& data, bool setProgramName)
{
if (data.isEmpty())
return false;
@@ -1524,7 +1524,7 @@ bool KExiv2::setExifTagData(const char *exifTagName, const QByteArray& data, boo
return false;
}
-bool KExiv2::setIptcTagData(const char *iptcTagName, const QByteArray& data, bool setProgramName)
+bool KExiv2::setIptcTagData(const char *iptcTagName, const TQByteArray& data, bool setProgramName)
{
if (data.isEmpty())
return false;
@@ -1579,9 +1579,9 @@ bool KExiv2::removeIptcTag(const char *iptcTagName, bool setProgramName)
Exiv2::IptcData::iterator it = d->iptcMetadata.begin();
while(it != d->iptcMetadata.end())
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
- if (key == QString(iptcTagName))
+ if (key == TQString(iptcTagName))
it = d->iptcMetadata.erase(it);
else
++it;
@@ -1597,71 +1597,71 @@ bool KExiv2::removeIptcTag(const char *iptcTagName, bool setProgramName)
return false;
}
-QString KExiv2::getExifTagTitle(const char *exifTagName)
+TQString KExiv2::getExifTagTitle(const char *exifTagName)
{
try
{
std::string exifkey(exifTagName);
Exiv2::ExifKey ek(exifkey);
- return QString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
+ return TQString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
}
catch (Exiv2::Error& e)
{
d->printExiv2ExceptionError("Cannot get metadata tag title using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-QString KExiv2::getExifTagDescription(const char *exifTagName)
+TQString KExiv2::getExifTagDescription(const char *exifTagName)
{
try
{
std::string exifkey(exifTagName);
Exiv2::ExifKey ek(exifkey);
- return QString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
+ return TQString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
}
catch (Exiv2::Error& e)
{
d->printExiv2ExceptionError("Cannot get metadata tag description using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-QString KExiv2::getIptcTagTitle(const char *iptcTagName)
+TQString KExiv2::getIptcTagTitle(const char *iptcTagName)
{
try
{
std::string iptckey(iptcTagName);
Exiv2::IptcKey ik(iptckey);
- return QString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetTitle(ik.tag(), ik.record()) );
+ return TQString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetTitle(ik.tag(), ik.record()) );
}
catch (Exiv2::Error& e)
{
d->printExiv2ExceptionError("Cannot get metadata tag title using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-QString KExiv2::getIptcTagDescription(const char *iptcTagName)
+TQString KExiv2::getIptcTagDescription(const char *iptcTagName)
{
try
{
std::string iptckey(iptcTagName);
Exiv2::IptcKey ik(iptckey);
- return QString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetDesc(ik.tag(), ik.record()) );
+ return TQString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetDesc(ik.tag(), ik.record()) );
}
catch (Exiv2::Error& e)
{
d->printExiv2ExceptionError("Cannot get metadata tag description using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList &exifKeysFilter, bool invertSelection)
+KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const TQStringList &exifKeysFilter, bool invertSelection)
{
if (d->exifMetadata.empty())
return MetaDataMap();
@@ -1671,15 +1671,15 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList &exifKeysFilte
Exiv2::ExifData exifData = d->exifMetadata;
exifData.sortByKey();
- QString ifDItemName;
+ TQString ifDItemName;
MetaDataMap metaDataMap;
for (Exiv2::ExifData::iterator md = exifData.begin(); md != exifData.end(); ++md)
{
- QString key = QString::fromAscii(md->key().c_str());
+ TQString key = TQString::fromAscii(md->key().c_str());
// Decode the tag value with a user friendly output.
- QString tagValue;
+ TQString tagValue;
if (key == "Exif.Photo.UserComment")
{
tagValue = d->convertCommentValue(*md);
@@ -1690,20 +1690,20 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList &exifKeysFilte
os << *md;
// Exif tag contents can be an i18n strings, no only simple ascii.
- tagValue = QString::fromLocal8Bit(os.str().c_str());
+ tagValue = TQString::fromLocal8Bit(os.str().c_str());
}
- tagValue.replace("\n", " ");
+ tagValue.tqreplace("\n", " ");
// We apply a filter to get only the Exif tags that we need.
if (!invertSelection)
{
- if (exifKeysFilter.contains(key.section(".", 1, 1)))
+ if (exifKeysFilter.tqcontains(key.section(".", 1, 1)))
metaDataMap.insert(key, tagValue);
}
else
{
- if (!exifKeysFilter.contains(key.section(".", 1, 1)))
+ if (!exifKeysFilter.tqcontains(key.section(".", 1, 1)))
metaDataMap.insert(key, tagValue);
}
}
@@ -1718,7 +1718,7 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList &exifKeysFilte
return MetaDataMap();
}
-KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const QStringList &iptcKeysFilter, bool invertSelection)
+KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const TQStringList &iptcKeysFilter, bool invertSelection)
{
if (d->iptcMetadata.empty())
return MetaDataMap();
@@ -1728,52 +1728,52 @@ KExiv2::MetaDataMap KExiv2::getIptcTagsDataList(const QStringList &iptcKeysFilte
Exiv2::IptcData iptcData = d->iptcMetadata;
iptcData.sortByKey();
- QString ifDItemName;
+ TQString ifDItemName;
MetaDataMap metaDataMap;
for (Exiv2::IptcData::iterator md = iptcData.begin(); md != iptcData.end(); ++md)
{
- QString key = QString::fromAscii(md->key().c_str());
+ TQString key = TQString::fromAscii(md->key().c_str());
// Decode the tag value with a user friendly output.
std::ostringstream os;
os << *md;
- QString value = QString::fromAscii(os.str().c_str());
+ TQString value = TQString::fromAscii(os.str().c_str());
// To make a string just on one line.
- value.replace("\n", " ");
+ value.tqreplace("\n", " ");
// Some IPTC key are redondancy. check if already one exist...
- MetaDataMap::iterator it = metaDataMap.find(key);
+ MetaDataMap::iterator it = metaDataMap.tqfind(key);
// We apply a filter to get only the Exif tags that we need.
if (!invertSelection)
{
- if (iptcKeysFilter.contains(key.section(".", 1, 1)))
+ if (iptcKeysFilter.tqcontains(key.section(".", 1, 1)))
{
if (it == metaDataMap.end())
metaDataMap.insert(key, value);
else
{
- QString v = *it;
+ TQString v = *it;
v.append(", ");
v.append(value);
- metaDataMap.replace(key, v);
+ metaDataMap.tqreplace(key, v);
}
}
}
else
{
- if (!iptcKeysFilter.contains(key.section(".", 1, 1)))
+ if (!iptcKeysFilter.tqcontains(key.section(".", 1, 1)))
{
if (it == metaDataMap.end())
metaDataMap.insert(key, value);
else
{
- QString v = *it;
+ TQString v = *it;
v.append(", ");
v.append(value);
- metaDataMap.replace(key, v);
+ metaDataMap.tqreplace(key, v);
}
}
}
@@ -1798,13 +1798,13 @@ bool KExiv2::getGPSInfo(double& altitude, double& latitude, double& longitude) c
// Get the reference in first.
- QByteArray latRef = getExifTagData("Exif.GPSInfo.GPSLatitudeRef");
+ TQByteArray latRef = getExifTagData("Exif.GPSInfo.GPSLatitudeRef");
if (latRef.isEmpty()) return false;
- QByteArray lngRef = getExifTagData("Exif.GPSInfo.GPSLongitudeRef");
+ TQByteArray lngRef = getExifTagData("Exif.GPSInfo.GPSLongitudeRef");
if (lngRef.isEmpty()) return false;
- QByteArray altRef = getExifTagData("Exif.GPSInfo.GPSAltitudeRef");
+ TQByteArray altRef = getExifTagData("Exif.GPSInfo.GPSAltitudeRef");
// Latitude decoding.
@@ -2012,18 +2012,18 @@ bool KExiv2::removeGPSInfo(bool setProgramName)
try
{
- QStringList gpsTagsKeys;
+ TQStringList gpsTagsKeys;
for (Exiv2::ExifData::iterator it = d->exifMetadata.begin();
it != d->exifMetadata.end(); ++it)
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
- if (key.section(".", 1, 1) == QString("GPSInfo"))
+ if (key.section(".", 1, 1) == TQString("GPSInfo"))
gpsTagsKeys.append(key);
}
- for(QStringList::Iterator it2 = gpsTagsKeys.begin(); it2 != gpsTagsKeys.end(); ++it2)
+ for(TQStringList::Iterator it2 = gpsTagsKeys.begin(); it2 != gpsTagsKeys.end(); ++it2)
{
Exiv2::ExifKey gpsKey((*it2).ascii());
Exiv2::ExifData::iterator it3 = d->exifMetadata.findKey(gpsKey);
@@ -2101,22 +2101,22 @@ void KExiv2::convertToRational(double number, long int* numerator,
*denominator = (int)denTemp;
}
-QStringList KExiv2::getImageKeywords() const
+TQStringList KExiv2::getImageKeywords() const
{
try
{
if (!d->iptcMetadata.empty())
{
- QStringList keywords;
+ TQStringList keywords;
Exiv2::IptcData iptcData(d->iptcMetadata);
for (Exiv2::IptcData::iterator it = iptcData.begin(); it != iptcData.end(); ++it)
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
- if (key == QString("Iptc.Application2.Keywords"))
+ if (key == TQString("Iptc.Application2.Keywords"))
{
- QString val(it->toString().c_str());
+ TQString val(it->toString().c_str());
keywords.append(val);
}
}
@@ -2129,10 +2129,10 @@ QStringList KExiv2::getImageKeywords() const
d->printExiv2ExceptionError("Cannot get IPTC Keywords from image using Exiv2 ", e);
}
- return QStringList();
+ return TQStringList();
}
-bool KExiv2::setImageKeywords(const QStringList& oldKeywords, const QStringList& newKeywords,
+bool KExiv2::setImageKeywords(const TQStringList& oldKeywords, const TQStringList& newKeywords,
bool setProgramName)
{
if (!setProgramId(setProgramName))
@@ -2140,8 +2140,8 @@ bool KExiv2::setImageKeywords(const QStringList& oldKeywords, const QStringList&
try
{
- QStringList oldkeys = oldKeywords;
- QStringList newkeys = newKeywords;
+ TQStringList oldkeys = oldKeywords;
+ TQStringList newkeys = newKeywords;
qDebug("%s ==> Keywords: %s", d->filePath.ascii(), newkeys.join(",").ascii());
@@ -2151,12 +2151,12 @@ bool KExiv2::setImageKeywords(const QStringList& oldKeywords, const QStringList&
while(it != iptcData.end())
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
- QString val(it->toString().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
+ TQString val(it->toString().c_str());
// Also remove new keywords to avoid duplicates. They will be added again below.
- if ( key == QString("Iptc.Application2.Keywords") &&
- (oldKeywords.contains(val) || newKeywords.contains(val))
+ if ( key == TQString("Iptc.Application2.Keywords") &&
+ (oldKeywords.tqcontains(val) || newKeywords.tqcontains(val))
)
it = iptcData.erase(it);
else
@@ -2167,9 +2167,9 @@ bool KExiv2::setImageKeywords(const QStringList& oldKeywords, const QStringList&
Exiv2::IptcKey iptcTag("Iptc.Application2.Keywords");
- for (QStringList::iterator it = newkeys.begin(); it != newkeys.end(); ++it)
+ for (TQStringList::iterator it = newkeys.begin(); it != newkeys.end(); ++it)
{
- QString key = *it;
+ TQString key = *it;
key.truncate(64);
Exiv2::Value::AutoPtr val = Exiv2::Value::create(Exiv2::string);
@@ -2189,22 +2189,22 @@ bool KExiv2::setImageKeywords(const QStringList& oldKeywords, const QStringList&
return false;
}
-QStringList KExiv2::getImageSubjects() const
+TQStringList KExiv2::getImageSubjects() const
{
try
{
if (!d->iptcMetadata.empty())
{
- QStringList subjects;
+ TQStringList subjects;
Exiv2::IptcData iptcData(d->iptcMetadata);
for (Exiv2::IptcData::iterator it = iptcData.begin(); it != iptcData.end(); ++it)
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
- if (key == QString("Iptc.Application2.Subject"))
+ if (key == TQString("Iptc.Application2.Subject"))
{
- QString val(it->toString().c_str());
+ TQString val(it->toString().c_str());
subjects.append(val);
}
}
@@ -2217,10 +2217,10 @@ QStringList KExiv2::getImageSubjects() const
d->printExiv2ExceptionError("Cannot get IPTC Subjects from image using Exiv2 ", e);
}
- return QStringList();
+ return TQStringList();
}
-bool KExiv2::setImageSubjects(const QStringList& oldSubjects, const QStringList& newSubjects,
+bool KExiv2::setImageSubjects(const TQStringList& oldSubjects, const TQStringList& newSubjects,
bool setProgramName)
{
if (!setProgramId(setProgramName))
@@ -2228,8 +2228,8 @@ bool KExiv2::setImageSubjects(const QStringList& oldSubjects, const QStringList&
try
{
- QStringList oldDef = oldSubjects;
- QStringList newDef = newSubjects;
+ TQStringList oldDef = oldSubjects;
+ TQStringList newDef = newSubjects;
// Remove all old subjects.
Exiv2::IptcData iptcData(d->iptcMetadata);
@@ -2237,10 +2237,10 @@ bool KExiv2::setImageSubjects(const QStringList& oldSubjects, const QStringList&
while(it != iptcData.end())
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
- QString val(it->toString().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
+ TQString val(it->toString().c_str());
- if (key == QString("Iptc.Application2.Subject") && oldDef.contains(val))
+ if (key == TQString("Iptc.Application2.Subject") && oldDef.tqcontains(val))
it = iptcData.erase(it);
else
++it;
@@ -2250,9 +2250,9 @@ bool KExiv2::setImageSubjects(const QStringList& oldSubjects, const QStringList&
Exiv2::IptcKey iptcTag("Iptc.Application2.Subject");
- for (QStringList::iterator it = newDef.begin(); it != newDef.end(); ++it)
+ for (TQStringList::iterator it = newDef.begin(); it != newDef.end(); ++it)
{
- QString key = *it;
+ TQString key = *it;
key.truncate(236);
Exiv2::Value::AutoPtr val = Exiv2::Value::create(Exiv2::string);
@@ -2272,22 +2272,22 @@ bool KExiv2::setImageSubjects(const QStringList& oldSubjects, const QStringList&
return false;
}
-QStringList KExiv2::getImageSubCategories() const
+TQStringList KExiv2::getImageSubCategories() const
{
try
{
if (!d->iptcMetadata.empty())
{
- QStringList subCategories;
+ TQStringList subCategories;
Exiv2::IptcData iptcData(d->iptcMetadata);
for (Exiv2::IptcData::iterator it = iptcData.begin(); it != iptcData.end(); ++it)
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
- if (key == QString("Iptc.Application2.SuppCategory"))
+ if (key == TQString("Iptc.Application2.SuppCategory"))
{
- QString val(it->toString().c_str());
+ TQString val(it->toString().c_str());
subCategories.append(val);
}
}
@@ -2300,10 +2300,10 @@ QStringList KExiv2::getImageSubCategories() const
d->printExiv2ExceptionError("Cannot get IPTC Sub Categories from image using Exiv2 ", e);
}
- return QStringList();
+ return TQStringList();
}
-bool KExiv2::setImageSubCategories(const QStringList& oldSubCategories, const QStringList& newSubCategories,
+bool KExiv2::setImageSubCategories(const TQStringList& oldSubCategories, const TQStringList& newSubCategories,
bool setProgramName)
{
if (!setProgramId(setProgramName))
@@ -2311,8 +2311,8 @@ bool KExiv2::setImageSubCategories(const QStringList& oldSubCategories, const QS
try
{
- QStringList oldkeys = oldSubCategories;
- QStringList newkeys = newSubCategories;
+ TQStringList oldkeys = oldSubCategories;
+ TQStringList newkeys = newSubCategories;
// Remove all old Sub Categories.
Exiv2::IptcData iptcData(d->iptcMetadata);
@@ -2320,10 +2320,10 @@ bool KExiv2::setImageSubCategories(const QStringList& oldSubCategories, const QS
while(it != iptcData.end())
{
- QString key = QString::fromLocal8Bit(it->key().c_str());
- QString val(it->toString().c_str());
+ TQString key = TQString::fromLocal8Bit(it->key().c_str());
+ TQString val(it->toString().c_str());
- if (key == QString("Iptc.Application2.SuppCategory") && oldSubCategories.contains(val))
+ if (key == TQString("Iptc.Application2.SuppCategory") && oldSubCategories.tqcontains(val))
it = iptcData.erase(it);
else
++it;
@@ -2334,9 +2334,9 @@ bool KExiv2::setImageSubCategories(const QStringList& oldSubCategories, const QS
Exiv2::IptcKey iptcTag("Iptc.Application2.SuppCategory");
- for (QStringList::iterator it = newkeys.begin(); it != newkeys.end(); ++it)
+ for (TQStringList::iterator it = newkeys.begin(); it != newkeys.end(); ++it)
{
- QString key = *it;
+ TQString key = *it;
key.truncate(32);
Exiv2::Value::AutoPtr val = Exiv2::Value::create(Exiv2::string);
@@ -2356,7 +2356,7 @@ bool KExiv2::setImageSubCategories(const QStringList& oldSubCategories, const QS
return false;
}
-QString KExiv2::getExifComment() const
+TQString KExiv2::getExifComment() const
{
try
{
@@ -2368,7 +2368,7 @@ QString KExiv2::getExifComment() const
if (it != exifData.end())
{
- QString exifComment = d->convertCommentValue(*it);
+ TQString exifComment = d->convertCommentValue(*it);
// some cameras fill the UserComment with whitespace
if (!exifComment.isEmpty() && !exifComment.stripWhiteSpace().isEmpty())
@@ -2381,10 +2381,10 @@ QString KExiv2::getExifComment() const
d->printExiv2ExceptionError("Cannot find Exif User Comment using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-bool KExiv2::setExifComment(const QString& comment, bool setProgramName)
+bool KExiv2::setExifComment(const TQString& comment, bool setProgramName)
{
if (!setProgramId(setProgramName))
return false;
@@ -2395,7 +2395,7 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName)
return false;
// Write as Unicode only when necessary.
- QTextCodec *latin1Codec = QTextCodec::codecForName("iso8859-1");
+ TQTextCodec *latin1Codec = TQTextCodec::codecForName("iso8859-1");
if (latin1Codec->canEncode(comment))
{
// write as ASCII
diff --git a/libkexiv2/libkexiv2/kexiv2.h b/libkexiv2/libkexiv2/kexiv2.h
index 4ddac43..c83ad93 100644
--- a/libkexiv2/libkexiv2/kexiv2.h
+++ b/libkexiv2/libkexiv2/kexiv2.h
@@ -30,11 +30,11 @@
// QT includes.
-#include <qcstring.h>
-#include <qstring.h>
-#include <qimage.h>
-#include <qdatetime.h>
-#include <qmap.h>
+#include <tqcstring.h>
+#include <tqstring.h>
+#include <tqimage.h>
+#include <tqdatetime.h>
+#include <tqmap.h>
// Local includes.
@@ -78,7 +78,7 @@ public:
/** A map used by decodeExifMetadata() decodeIptcMetadata() methods
to store Tags Key and Tags Value.
*/
- typedef QMap<QString, QString> MetaDataMap;
+ typedef TQMap<TQString, TQString> MetaDataMap;
public:
@@ -88,7 +88,7 @@ public:
/** Contructor to Load Metadata from image file.
*/
- KExiv2(const QString& filePath);
+ KExiv2(const TQString& filePath);
/** Standard destructor
*/
@@ -96,15 +96,15 @@ public:
/** Return true if library can writte metadata to typeMime file format.
*/
- static bool supportMetadataWritting(const QString& typeMime);
+ static bool supportMetadataWritting(const TQString& typeMime);
/** Return a string version of Exiv2 release in format "major.minor.patch"
*/
- static QString Exiv2Version();
+ static TQString Exiv2Version();
/** Return a string version of libkexiv2 release
*/
- static QString version();
+ static TQString version();
//-- Metadata manipulation methods ----------------------------------------------
@@ -122,62 +122,62 @@ public:
/** Return the file path open with the current instance of interface.
*/
- QString getFilePath() const;
+ TQString getFilePath() const;
- /** Return a Qt byte array copy of Comments container get from current image.
+ /** Return a TQt byte array copy of Comments container get from current image.
Comments are JFIF section of JPEG images. Look Exiv2 API for more information.
- Return a null Qt byte array if there is no Comments metadata in memory.
+ Return a null TQt byte array if there is no Comments metadata in memory.
*/
- QByteArray getComments() const;
+ TQByteArray getComments() const;
- /** Return a Qt string object of Comments from current image decoded using
+ /** Return a TQt string object of Comments from current image decoded using
the 'detectEncodingAndDecode()' method. Return a null string if there is no
Comments metadata available.
*/
- QString getCommentsDecoded() const;
+ TQString getCommentsDecoded() const;
- /** Return a Qt byte array copy of Exif container get from current image.
- Return a null Qt byte array if there is no Exif metadata in memory.
+ /** Return a TQt byte array copy of Exif container get from current image.
+ Return a null TQt byte array if there is no Exif metadata in memory.
*/
- QByteArray getExif() const;
+ TQByteArray getExif() const;
- /** Return a Qt byte array copy of Iptc container get from current image.
+ /** Return a TQt byte array copy of Iptc container get from current image.
Set true 'addIrbHeader' parameter to add an Irb header to IPTC metadata.
- Return a null Qt byte array if there is no Iptc metadata in memory.
+ Return a null TQt byte array if there is no Iptc metadata in memory.
*/
- QByteArray getIptc(bool addIrbHeader=false) const;
+ TQByteArray getIptc(bool addIrbHeader=false) const;
- /** Set the Comments data using a Qt byte array. Return true if Comments metadata
+ /** Set the Comments data using a TQt byte array. Return true if Comments metadata
have been changed in memory.
*/
- bool setComments(const QByteArray& data);
+ bool setComments(const TQByteArray& data);
- /** Set the Exif data using a Qt byte array. Return true if Exif metadata
+ /** Set the Exif data using a TQt byte array. Return true if Exif metadata
have been changed in memory.
*/
- bool setExif(const QByteArray& data);
+ bool setExif(const TQByteArray& data);
- /** Set the Iptc data using a Qt byte array. Return true if Iptc metadata
+ /** Set the Iptc data using a TQt byte array. Return true if Iptc metadata
have been changed in memory.
*/
- bool setIptc(const QByteArray& data);
+ bool setIptc(const TQByteArray& data);
//-- File access methods ----------------------------------------------
/** Load all metadata (EXIF, IPTC and JFIF Comments) from a byte array.
Return true if metadata have been loaded successfully from image data.
*/
- bool load(const QByteArray& imgData);
+ bool load(const TQByteArray& imgData);
/** Load all metadata (EXIF, IPTC and JFIF Comments) from a picture (JPEG, RAW, TIFF, PNG,
DNG, etc...). Return true if metadata have been loaded successfully from file.
*/
- virtual bool load(const QString& filePath);
+ virtual bool load(const TQString& filePath);
/** Save all metadata to a file. This one can be different than original picture to perform
transfert operation Return true if metadata have been saved into file.
*/
- bool save(const QString& filePath);
+ bool save(const TQString& filePath);
/** The same than save() method, but it apply on current image. Return true if metadata
have been saved into file.
@@ -186,47 +186,47 @@ public:
/** return true is the file metadata cannot be written by Exiv2.
*/
- static bool isReadOnly(const QString& filePath);
+ static bool isReadOnly(const TQString& filePath);
/** Return 'true' if Comments can be written in file.
*/
- static bool canWriteComment(const QString& filePath);
+ static bool canWriteComment(const TQString& filePath);
/** Return 'true' if Exif can be written in file.
*/
- static bool canWriteExif(const QString& filePath);
+ static bool canWriteExif(const TQString& filePath);
/** Return 'true' if Iptc can be written in file.
*/
- static bool canWriteIptc(const QString& filePath);
+ static bool canWriteIptc(const TQString& filePath);
//-- Metadata Image Information manipulation methods ----------------
/** Set Program name and program version in Exif and Iptc Metadata. Return true if information
have been changed in metadata.
*/
- bool setImageProgramId(const QString& program, const QString& version);
+ bool setImageProgramId(const TQString& program, const TQString& version);
/** Return the size of image in pixels using Exif tags. Return a null dimmension if size cannot
be found.
*/
- QSize getImageDimensions() const;
+ TQSize getImageDimensions() const;
/** Set the size of image in pixels in Exif tags. Return true if size have been changed
in metadata.
*/
- bool setImageDimensions(const QSize& size, bool setProgramName=true);
+ bool setImageDimensions(const TQSize& size, bool setProgramName=true);
- /** Return a QImage copy of Exif thumbnail image. Return a null image if thumbnail cannot
+ /** Return a TQImage copy of Exif thumbnail image. Return a null image if thumbnail cannot
be found. The 'fixOrientation' parameter will rotate automatically the thumbnail if Exif
orientation tags information are attached with thumbnail.
*/
- QImage getExifThumbnail(bool fixOrientation) const;
+ TQImage getExifThumbnail(bool fixOrientation) const;
/** Set the Exif Thumbnail image. The thumbnail image must have the right dimensions before.
Look Exif specification for details. Return true if thumbnail have been changed in metadata.
*/
- bool setExifThumbnail(const QImage& thumb, bool setProgramName=true);
+ bool setExifThumbnail(const TQImage& thumb, bool setProgramName=true);
/** Return the image orientation set in Exif metadata. The makernotes of image are also parsed to
get this information. See ImageOrientation values for details.
@@ -251,18 +251,18 @@ public:
/** Return the time stamp of image. Exif information are check in first, IPTC in second
if image don't have Exif information. If no time stamp is found, a null date is returned.
*/
- QDateTime getImageDateTime() const;
+ TQDateTime getImageDateTime() const;
/** Set the Exif and Iptc time stamp. If 'setDateTimeDigitized' parameter is true, the 'Digitalized'
time stamp is set, else only 'Created' time stamp is set.
*/
- bool setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitized = false,
+ bool setImageDateTime(const TQDateTime& dateTime, bool setDateTimeDigitized = false,
bool setProgramName=true);
- /** Return a QImage copy of Iptc preview image. Return a null image if preview cannot
+ /** Return a TQImage copy of Iptc preview image. Return a null image if preview cannot
be found.
*/
- bool getImagePreview(QImage& preview) const;
+ bool getImagePreview(TQImage& preview) const;
/** Set the Iptc preview image. The thumbnail image must have the right size before (64Kb max
with JPEG file, else 256Kb). Look Iptc specification for details. Return true if preview
@@ -270,52 +270,52 @@ public:
Re-implemente this method if you want to use another image file format than JPEG to
save preview.
*/
- virtual bool setImagePreview(const QImage& preview, bool setProgramName=true);
+ virtual bool setImagePreview(const TQImage& preview, bool setProgramName=true);
/** Return a strings list of Iptc keywords from image. Return an empty list if no keyword are set. */
- QStringList getImageKeywords() const;
+ TQStringList getImageKeywords() const;
/** Set Iptc keywords using a list of strings defined by 'newKeywords' parameter. Use 'getImageKeywords()'
method to set 'oldKeywords' parameter with existing keywords from image. The method will compare
all new keywords with all old keywords to prevent duplicate entries in image. Return true if keywords
have been changed in metadata.
*/
- bool setImageKeywords(const QStringList& oldKeywords, const QStringList& newKeywords,
+ bool setImageKeywords(const TQStringList& oldKeywords, const TQStringList& newKeywords,
bool setProgramName=true);
/** Return a strings list of Iptc subjects from image. Return an empty list if no subject are set. */
- QStringList getImageSubjects() const;
+ TQStringList getImageSubjects() const;
/** Set Iptc subjects using a list of strings defined by 'newSubjects' parameter. Use 'getImageSubjects()'
method to set 'oldSubjects' parameter with existing subjects from image. The method will compare
all new subjects with all old subjects to prevent duplicate entries in image. Return true if subjects
have been changed in metadata.
*/
- bool setImageSubjects(const QStringList& oldSubjects, const QStringList& newSubjects,
+ bool setImageSubjects(const TQStringList& oldSubjects, const TQStringList& newSubjects,
bool setProgramName=true);
/** Return a strings list of Iptc sub-categories from image. Return an empty list if no sub-category
are set.
*/
- QStringList getImageSubCategories() const;
+ TQStringList getImageSubCategories() const;
/** Set Iptc sub-categories using a list of strings defined by 'newSubCategories' parameter. Use
'getImageSubCategories()' method to set 'oldSubCategories' parameter with existing sub-categories
from image. The method will compare all new sub-categories with all old sub-categories to prevent
duplicate entries in image. Return true if sub-categories have been changed in metadata.
*/
- bool setImageSubCategories(const QStringList& oldSubCategories, const QStringList& newSubCategories,
+ bool setImageSubCategories(const TQStringList& oldSubCategories, const TQStringList& newSubCategories,
bool setProgramName=true);
- /** Return a QString copy of Exif user comments. Return a null string if user comments cannot
+ /** Return a TQString copy of Exif user comments. Return a null string if user comments cannot
be found.
*/
- QString getExifComment() const;
+ TQString getExifComment() const;
/** Set the Exif user comments from image. Look Exif specification for more details about this tag.
Return true if Exif user comments have been changed in metadata.
*/
- bool setExifComment(const QString& comment, bool setProgramName=true);
+ bool setExifComment(const TQString& comment, bool setProgramName=true);
/** Get all GPS location information set in image. Return true if all information can be found.
*/
@@ -336,11 +336,11 @@ public:
/** Get an Exif tags content like a string. If 'escapeCR' parameter is true, the CR characters
will be removed. If Exif tag cannot be found a null string is returned.
*/
- QString getExifTagString(const char *exifTagName, bool escapeCR=true) const;
+ TQString getExifTagString(const char *exifTagName, bool escapeCR=true) const;
/** Set an Exif tag content using a string. Return true if tag is set successfully.
*/
- bool setExifTagString(const char *exifTagName, const QString& value, bool setProgramName=true);
+ bool setExifTagString(const char *exifTagName, const TQString& value, bool setProgramName=true);
/** Get an Exif tags content like a long value. Return true if Exif tag be found.
*/
@@ -365,29 +365,29 @@ public:
/** Get an Exif tags content like a bytes array. Return an empty bytes array if Exif
tag cannot be found.
*/
- QByteArray getExifTagData(const char *exifTagName) const;
+ TQByteArray getExifTagData(const char *exifTagName) const;
/** Set an Exif tag content using a bytes array. Return true if tag is set successfully.
*/
- bool setExifTagData(const char *exifTagName, const QByteArray& data, bool setProgramName=true);
+ bool setExifTagData(const char *exifTagName, const TQByteArray& data, bool setProgramName=true);
/** Get an Iptc tags content like a string. If 'escapeCR' parameter is true, the CR characters
will be removed. If Iptc tag cannot be found a null string is returned.
*/
- QString getIptcTagString(const char* iptcTagName, bool escapeCR=true) const;
+ TQString getIptcTagString(const char* iptcTagName, bool escapeCR=true) const;
/** Set an Iptc tag content using a string. Return true if tag is set successfully.
*/
- bool setIptcTagString(const char *iptcTagName, const QString& value, bool setProgramName=true);
+ bool setIptcTagString(const char *iptcTagName, const TQString& value, bool setProgramName=true);
/** Get an Iptc tags content like a bytes array. Return an empty bytes array if Iptc
tag cannot be found.
*/
- QByteArray getIptcTagData(const char *iptcTagName) const;
+ TQByteArray getIptcTagData(const char *iptcTagName) const;
/** Set an Iptc tag content using a bytes array. Return true if tag is set successfully.
*/
- bool setIptcTagData(const char *iptcTagName, const QByteArray& data, bool setProgramName=true);
+ bool setIptcTagData(const char *iptcTagName, const TQByteArray& data, bool setProgramName=true);
/** Remove the Exif tag 'exifTagName' from Exif metadata. Return true if tag is
removed successfully.
@@ -401,24 +401,24 @@ public:
/** Return the Exif Tag title or a null string.
*/
- QString getExifTagTitle(const char *exifTagName);
+ TQString getExifTagTitle(const char *exifTagName);
/** Return the Exif Tag description or a null string.
*/
- QString getExifTagDescription(const char *exifTagName);
+ TQString getExifTagDescription(const char *exifTagName);
/** Return the Iptc Tag title or a null string.
*/
- QString getIptcTagTitle(const char *iptcTagName);
+ TQString getIptcTagTitle(const char *iptcTagName);
/** Return the Iptc Tag description or a null string.
*/
- QString getIptcTagDescription(const char *iptcTagName);
+ TQString getIptcTagDescription(const char *iptcTagName);
/** Return a map of Exif tags name/value found in metadata sorted by
Exif keys given by 'exifKeysFilter'.
- 'exifKeysFilter' is a QStringList of Exif keys.
+ 'exifKeysFilter' is a TQStringList of Exif keys.
For example, if you use the string list given below:
"Iop"
@@ -433,12 +433,12 @@ public:
- not include "Iop", or "Thumbnail", or "Image", or "Photo" in the Exif tag keys
if 'inverSelection' is true.
*/
- KExiv2::MetaDataMap getExifTagsDataList(const QStringList &exifKeysFilter, bool invertSelection=false);
+ KExiv2::MetaDataMap getExifTagsDataList(const TQStringList &exifKeysFilter, bool invertSelection=false);
/** Return a map of Iptc tags name/value found in metadata sorted by
Iptc keys given by 'iptcKeysFilter'.
- 'iptcKeysFilter' is a QStringList of Iptc keys.
+ 'iptcKeysFilter' is a TQStringList of Iptc keys.
For example, if you use the string list given below:
"Envelope"
@@ -451,7 +451,7 @@ public:
- not include "Envelope", or "Application2" in the Iptc tag keys
if 'inverSelection' is true.
*/
- KExiv2::MetaDataMap getIptcTagsDataList(const QStringList &iptcKeysFilter, bool invertSelection=false);
+ KExiv2::MetaDataMap getIptcTagsDataList(const TQStringList &iptcKeysFilter, bool invertSelection=false);
//-- Advanced methods to convert and decode data -------------------------
@@ -471,8 +471,8 @@ protected:
if (on)
{
- QString version(digikam_version);
- QString software("digiKam");
+ TQString version(digikam_version);
+ TQString software("digiKam");
return setImageProgramId(software, version);
}
diff --git a/libkexiv2/libkexiv2/kexiv2private.cpp b/libkexiv2/libkexiv2/kexiv2private.cpp
index a1b7a9f..180806b 100644
--- a/libkexiv2/libkexiv2/kexiv2private.cpp
+++ b/libkexiv2/libkexiv2/kexiv2private.cpp
@@ -101,13 +101,13 @@ bool KExiv2Priv::setIptc(Exiv2::DataBuf const data)
return false;
}
-void KExiv2Priv::printExiv2ExceptionError(const QString& msg, Exiv2::Error& e)
+void KExiv2Priv::printExiv2ExceptionError(const TQString& msg, Exiv2::Error& e)
{
std::string s(e.what());
qDebug("%s (Error #%i: %s)", msg.ascii(), e.code(), s.c_str());
}
-QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
+TQString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
{
try
{
@@ -129,7 +129,7 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
#endif
// libexiv2 will prepend "charset=\"SomeCharset\" " if charset is specified
- // Before conversion to QString, we must know the charset, so we stay with std::string for a while
+ // Before conversion to TQString, we must know the charset, so we stay with std::string for a while
if (comment.length() > 8 && comment.substr(0, 8) == "charset=")
{
// the prepended charset specification is followed by a blank
@@ -145,19 +145,19 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
if (charset == "\"Unicode\"")
{
- // QString expects a null-terminated UCS-2 string.
+ // TQString expects a null-terminated UCS-2 string.
// Is it already null terminated? In any case, add termination "\0\0" for safety.
comment.resize(comment.length() + 2, '\0');
- return QString::fromUcs2((unsigned short *)comment.data());
+ return TQString::fromUcs2((unsigned short *)comment.data());
}
else if (charset == "\"Jis\"")
{
- QTextCodec *codec = QTextCodec::codecForName("JIS7");
+ TQTextCodec *codec = TQTextCodec::codecForName("JIS7");
return codec->toUnicode(comment.c_str());
}
else if (charset == "\"Ascii\"")
{
- return QString::fromLatin1(comment.c_str());
+ return TQString::tqfromLatin1(comment.c_str());
}
else
{
@@ -169,40 +169,40 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
printExiv2ExceptionError("Cannot convert Comment using Exiv2 ", e);
}
- return QString();
+ return TQString();
}
-QString KExiv2Priv::detectEncodingAndDecode(const std::string &value)
+TQString KExiv2Priv::detectEncodingAndDecode(const std::string &value)
{
// For charset autodetection, we could use sophisticated code
- // (Mozilla chardet, KHTML's autodetection, QTextCodec::codecForContent),
+ // (Mozilla chardet, KHTML's autodetection, TQTextCodec::codecForContent),
// but that is probably too much.
// We check for UTF8, Local encoding and ASCII.
if (value.empty())
- return QString();
+ return TQString();
#if KDE_IS_VERSION(3,2,0)
if (KStringHandler::isUtf8(value.c_str()))
{
- return QString::fromUtf8(value.c_str());
+ return TQString::fromUtf8(value.c_str());
}
#else
// anyone who is still running KDE 3.0 or 3.1 is missing so many features
// that he will have to accept this missing feature.
- return QString::fromUtf8(value.c_str());
+ return TQString::fromUtf8(value.c_str());
#endif
// Utf8 has a pretty unique byte pattern.
// Thats not true for ASCII, it is not possible
// to reliably autodetect different ISO-8859 charsets.
- // We try if QTextCodec can decide here, otherwise we use Latin1.
+ // We try if TQTextCodec can decide here, otherwise we use Latin1.
// Or use local8Bit as default?
- // load QTextCodecs
- QTextCodec *latin1Codec = QTextCodec::codecForName("iso8859-1");
- //QTextCodec *utf8Codec = QTextCodec::codecForName("utf8");
- QTextCodec *localCodec = QTextCodec::codecForLocale();
+ // load TQTextCodecs
+ TQTextCodec *latin1Codec = TQTextCodec::codecForName("iso8859-1");
+ //TQTextCodec *utf8Codec = TQTextCodec::codecForName("utf8");
+ TQTextCodec *localCodec = TQTextCodec::codecForLocale();
// make heuristic match
int latin1Score = latin1Codec->heuristicContentMatch(value.c_str(), value.length());
@@ -213,14 +213,14 @@ QString KExiv2Priv::detectEncodingAndDecode(const std::string &value)
if (localScore >= 0 && localScore >= latin1Score)
{
// workaround for bug #134999:
- // The QLatin15Codec may crash if strlen < value.length()
+ // The TQLatin15Codec may crash if strlen < value.length()
int length = value.length();
- if (localCodec->name() == QString::fromLatin1("ISO 8859-15"))
+ if (localCodec->name() == TQString::tqfromLatin1("ISO 8859-15"))
length = strlen(value.c_str());
return localCodec->toUnicode(value.c_str(), length);
}
else
- return QString::fromLatin1(value.c_str());
+ return TQString::tqfromLatin1(value.c_str());
}
} // NameSpace KExiv2Iface
diff --git a/libkexiv2/libkexiv2/kexiv2private.h b/libkexiv2/libkexiv2/kexiv2private.h
index 1df5f94..3246fb0 100644
--- a/libkexiv2/libkexiv2/kexiv2private.h
+++ b/libkexiv2/libkexiv2/kexiv2private.h
@@ -34,13 +34,13 @@
#include <iomanip>
#include <string>
-// Qt includes.
+// TQt includes.
-#include <qfile.h>
-#include <qsize.h>
-#include <qtextcodec.h>
-#include <qwmatrix.h>
-#include <qfileinfo.h>
+#include <tqfile.h>
+#include <tqsize.h>
+#include <tqtextcodec.h>
+#include <tqwmatrix.h>
+#include <tqfileinfo.h>
// KDE includes.
@@ -105,19 +105,19 @@ public:
/** Generic method to print the Exiv2 C++ Exception error message from 'e'.
'msg' string is printed just before like debug header.
*/
- void printExiv2ExceptionError(const QString& msg, Exiv2::Error& e);
+ void printExiv2ExceptionError(const TQString& msg, Exiv2::Error& e);
- /** Wrapper method to convert a Comments content to a QString.
+ /** Wrapper method to convert a Comments content to a TQString.
*/
- QString convertCommentValue(const Exiv2::Exifdatum &exifDatum);
+ TQString convertCommentValue(const Exiv2::Exifdatum &exifDatum);
- /** Charset autodetection to convert a string to a QString.
+ /** Charset autodetection to convert a string to a TQString.
*/
- QString detectEncodingAndDecode(const std::string &value);
+ TQString detectEncodingAndDecode(const std::string &value);
public:
- QString filePath;
+ TQString filePath;
std::string imageComments;