Commit 793ee712 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

use kError() instead kDebug() here...

parent 8a8dc535
......@@ -279,7 +279,7 @@ bool KExiv2::loadFromData(const QByteArray& imgData) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -335,7 +335,7 @@ bool KExiv2::load(const QString& filePath) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
#ifdef _XMP_SUPPORT_
......@@ -365,7 +365,7 @@ bool KExiv2::load(const QString& filePath) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
#endif // _XMP_SUPPORT_
......
......@@ -85,7 +85,7 @@ bool KExiv2::Private::saveToXMPSidecar(const QFileInfo& finfo) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
return false;
}
}
......@@ -161,7 +161,7 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
return false;
}
}
......@@ -311,7 +311,7 @@ bool KExiv2::Private::saveOperations(const QFileInfo& finfo, Exiv2::Image::AutoP
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -330,7 +330,7 @@ void KExiv2Data::Private::clear()
void KExiv2::Private::printExiv2ExceptionError(const QString& msg, Exiv2::Error& e)
{
std::string s(e.what());
kDebug() << msg.toAscii().constData() << " (Error #"
kError() << msg.toAscii().constData() << " (Error #"
<< e.code() << ": " << s.c_str();
}
......@@ -388,7 +388,7 @@ QString KExiv2::Private::convertCommentValue(const Exiv2::Exifdatum& exifDatum)
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......
......@@ -46,12 +46,12 @@ bool KExiv2::canWriteComment(const QString& filePath)
catch( Exiv2::Error& e )
{
std::string s(e.what());
kDebug() << "Cannot check Comment access mode using Exiv2 (Error #"
kError() << "Cannot check Comment access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......
......@@ -54,12 +54,12 @@ bool KExiv2::canWriteExif(const QString& filePath)
catch( Exiv2::Error& e )
{
std::string s(e.what());
kDebug() << "Cannot check Exif access mode using Exiv2 (Error #"
kError() << "Cannot check Exif access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -83,7 +83,7 @@ bool KExiv2::clearExif() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -123,7 +123,7 @@ QByteArray KExiv2::getExifEncoded(bool addExifHeader) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QByteArray();
......@@ -142,13 +142,13 @@ bool KExiv2::setExif(const QByteArray& data) const
catch( Exiv2::Error& e )
{
if (!d->filePath.isEmpty())
kDebug() << "From file " << d->filePath.toAscii().constData();
kError() << "From file " << d->filePath.toAscii().constData();
d->printExiv2ExceptionError("Cannot set Exif data using Exiv2 ", e);
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -222,7 +222,7 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList& exifKeysFilte
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return MetaDataMap();
......@@ -274,7 +274,7 @@ QString KExiv2::getExifComment() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......@@ -338,7 +338,7 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -359,7 +359,7 @@ QString KExiv2::getExifTagTitle(const char* exifTagName)
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......@@ -380,7 +380,7 @@ QString KExiv2::getExifTagDescription(const char* exifTagName)
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......@@ -408,7 +408,7 @@ bool KExiv2::removeExifTag(const char* exifTagName, bool setProgramName) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -437,7 +437,7 @@ bool KExiv2::getExifTagRational(const char* exifTagName, long int& num, long int
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -459,7 +459,7 @@ bool KExiv2::setExifTagLong(const char* exifTagName, long val, bool setProgramNa
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -481,7 +481,7 @@ bool KExiv2::setExifTagRational(const char* exifTagName, long int num, long int
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -507,7 +507,7 @@ bool KExiv2::setExifTagData(const char* exifTagName, const QByteArray& data, boo
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -572,7 +572,7 @@ bool KExiv2::setExifTagVariant(const char* exifTagName, const QVariant& val,
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -669,7 +669,7 @@ QString KExiv2::createExifUserStringFromValue(const char* exifTagName, const QVa
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......@@ -701,7 +701,7 @@ bool KExiv2::getExifTagLong(const char* exifTagName, long& val, int component) c
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -732,7 +732,7 @@ QByteArray KExiv2::getExifTagData(const char* exifTagName) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QByteArray();
......@@ -818,7 +818,7 @@ QVariant KExiv2::getExifTagVariant(const char* exifTagName, bool rationalAsListO
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QVariant();
......@@ -851,7 +851,7 @@ QString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QString();
......@@ -873,7 +873,7 @@ bool KExiv2::setExifTagString(const char* exifTagName, const QString& value, boo
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -921,7 +921,7 @@ QImage KExiv2::getExifThumbnail(bool fixOrientation) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return thumbnail;
......@@ -966,7 +966,7 @@ bool KExiv2::setExifThumbnail(const QImage& thumbImage, bool setProgramName) con
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -1025,7 +1025,7 @@ bool KExiv2::setTiffThumbnail(const QImage& thumbImage, bool setProgramName) con
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -1046,7 +1046,7 @@ bool KExiv2::removeExifThumbnail() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -1098,7 +1098,7 @@ KExiv2::TagsMap KExiv2::getStdExifTagsList() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return TagsMap();
......@@ -1151,7 +1151,7 @@ KExiv2::TagsMap KExiv2::getMakernoteTagsList() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return TagsMap();
......
......@@ -132,7 +132,7 @@ bool KExiv2::getGPSLatitudeNumber(double* const latitude) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -228,7 +228,7 @@ bool KExiv2::getGPSLongitudeNumber(double* const longitude) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -302,7 +302,7 @@ bool KExiv2::getGPSAltitude(double* const altitude) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -360,7 +360,7 @@ bool KExiv2::initializeGPSInfo(const bool setProgramName)
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -492,7 +492,7 @@ bool KExiv2::setGPSInfo(const double* const altitude, const double latitude, con
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -581,7 +581,7 @@ bool KExiv2::removeGPSInfo(const bool setProgramName)
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......
......@@ -88,7 +88,7 @@ bool KExiv2::setImageProgramId(const QString& program, const QString& version) c
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -181,7 +181,7 @@ QSize KExiv2::getImageDimensions() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QSize();
......@@ -221,7 +221,7 @@ bool KExiv2::setImageDimensions(const QSize& size, bool setProgramName) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -316,7 +316,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return ORIENTATION_UNSPECIFIED;
......@@ -390,7 +390,7 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -500,7 +500,7 @@ bool KExiv2::setImageColorWorkSpace(ImageColorWorkSpace workspace, bool setProgr
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -518,9 +518,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::ExifKey key("Exif.Photo.DateTimeOriginal");
Exiv2::ExifData::iterator it = exifData.findKey(key);
if (it != exifData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Exif.Photo.DateTimeOriginal => " << dateTime;
......@@ -531,9 +533,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::ExifKey key("Exif.Photo.DateTimeDigitized");
Exiv2::ExifData::iterator it = exifData.findKey(key);
if (it != exifData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Exif.Photo.DateTimeDigitized => " << dateTime;
......@@ -544,9 +548,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::ExifKey key("Exif.Image.DateTime");
Exiv2::ExifData::iterator it = exifData.findKey(key);
if (it != exifData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Exif.Image.DateTime => " << dateTime;
......@@ -566,9 +572,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.exif.DateTimeOriginal");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.exif.DateTimeOriginal => " << dateTime;
......@@ -579,9 +587,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.exif.DateTimeDigitized");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.exif.DateTimeDigitized => " << dateTime;
......@@ -592,9 +602,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.photoshop.DateCreated");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.photoshop.DateCreated => " << dateTime;
......@@ -605,9 +617,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.xmp.CreateDate");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.xmp.CreateDate => " << dateTime;
......@@ -618,9 +632,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.tiff.DateTime");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.tiff.DateTime => " << dateTime;
......@@ -631,9 +647,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.xmp.ModifyDate");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.xmp.ModifyDate => " << dateTime;
......@@ -644,9 +662,11 @@ QDateTime KExiv2::getImageDateTime() const
{
Exiv2::XmpKey key("Xmp.xmp.MetadataDate");
Exiv2::XmpData::iterator it = xmpData.findKey(key);
if (it != xmpData.end())
{
QDateTime dateTime = QDateTime::fromString(it->toString().c_str(), Qt::ISODate);
if (dateTime.isValid())
{
kDebug() << "DateTime => Xmp.xmp.MetadataDate => " << dateTime;
......@@ -668,17 +688,20 @@ QDateTime KExiv2::getImageDateTime() const
Exiv2::IptcKey keyDateCreated("Iptc.Application2.DateCreated");
Exiv2::IptcData::iterator it = iptcData.findKey(keyDateCreated);
if (it != iptcData.end())
{
QString 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());
QDate date = QDate::fromString(IptcDateCreated, Qt::ISODate);
QTime time = QTime::fromString(IptcTimeCreated, Qt::ISODate);
QDateTime dateTime = QDateTime(date, time);
if (dateTime.isValid())
{
kDebug() << "DateTime => Iptc.Application2.DateCreated => " << dateTime;
......@@ -691,17 +714,20 @@ QDateTime KExiv2::getImageDateTime() const
Exiv2::IptcKey keyDigitizationDate("Iptc.Application2.DigitizationDate");
Exiv2::IptcData::iterator it3 = iptcData.findKey(keyDigitizationDate);
if (it3 != iptcData.end())
{
QString 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());
QDate date = QDate::fromString(IptcDateDigitization, Qt::ISODate);
QTime time = QTime::fromString(IptcTimeDigitization, Qt::ISODate);
QDateTime dateTime = QDateTime(date, time);
if (dateTime.isValid())
{
kDebug() << "DateTime => Iptc.Application2.DigitizationDate => " << dateTime;
......@@ -717,7 +743,7 @@ QDateTime KExiv2::getImageDateTime() const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return QDateTime();
......@@ -789,7 +815,7 @@ bool KExiv2::setImageDateTime(const QDateTime& dateTime, bool setDateTimeDigitiz
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -861,7 +887,7 @@ QDateTime KExiv2::getDigitizationDateTime(bool fallbackToCreationTime) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
if (fallbackToCreationTime)
......@@ -886,7 +912,7 @@ bool KExiv2::getImagePreview(QImage& preview) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......@@ -932,7 +958,7 @@ bool KExiv2::setImagePreview(const QImage& preview, bool setProgramName) const
}
catch(...)
{
kDebug() << "Default exception from Exiv2";
kError() << "Default exception from Exiv2";
}
return false;
......
......@@ -44,12 +44,12 @@ bool KExiv2::canWriteIptc(const QString& filePath)
catch(Exiv2::Error& e)
{
std::string s(e.what());
kDebug() << "Cannot check Iptc access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
kError() << "Cannot check Iptc access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
}
catch(...)
{