Commit 6a22771f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

kdebug--

parent aa0e7d2e
......@@ -42,7 +42,7 @@
#include <klocale.h>
#include <ktextedit.h>
#include <kcombobox.h>
#include <kdebug.h>
#include <QDebug>
using namespace KExiv2Iface;
class AltLangStrEdit::Private
......
......@@ -33,7 +33,7 @@
// KDE includes
#include <klocale.h>
#include <kdebug.h>
#include <QDebug>
namespace KExiv2Iface
{
......@@ -347,7 +347,7 @@ void CountrySelector::setCountry(const QString& countryCode)
}
setCurrentIndex(id);
kDebug() << count() << " :: " << id;
qDebug() << count() << " :: " << id;
}
bool CountrySelector::country(QString& countryCode, QString& countryName)
......
......@@ -279,7 +279,7 @@ bool KExiv2::loadFromData(const QByteArray& imgData) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -335,7 +335,7 @@ bool KExiv2::load(const QString& filePath) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
#ifdef _XMP_SUPPORT_
......@@ -365,7 +365,7 @@ bool KExiv2::load(const QString& filePath) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
#endif // _XMP_SUPPORT_
......@@ -393,7 +393,7 @@ bool KExiv2::save(const QString& imageFilePath) const
QFileInfo givenFileInfo(imageFilePath);
if (givenFileInfo.isSymLink())
{
kDebug() << "filePath" << imageFilePath << "is a symlink."
qDebug() << "filePath" << imageFilePath << "is a symlink."
<< "Using target" << givenFileInfo.canonicalPath();
regularFilePath = givenFileInfo.canonicalPath();// Walk all the symlinks
......@@ -404,7 +404,7 @@ bool KExiv2::save(const QString& imageFilePath) const
QFileInfo dinfo(finfo.path());
if (!dinfo.isWritable())
{
kDebug() << "Dir '" << dinfo.filePath() << "' is read-only. Metadata not saved.";
qDebug() << "Dir '" << dinfo.filePath() << "' is read-only. Metadata not saved.";
return false;
}
......@@ -414,7 +414,7 @@ bool KExiv2::save(const QString& imageFilePath) const
bool writtenToFile = false;
bool writtenToSidecar = false;
kDebug() << "KExiv2::metadataWritingMode" << d->metadataWritingMode;
qDebug() << "KExiv2::metadataWritingMode" << d->metadataWritingMode;
switch(d->metadataWritingMode)
{
......@@ -436,21 +436,21 @@ bool KExiv2::save(const QString& imageFilePath) const
if (writeToFile)
{
kDebug() << "Will write Metadata to file" << finfo.fileName();
qDebug() << "Will write Metadata to file" << finfo.fileName();
writtenToFile = d->saveToFile(finfo);
if (writeToFile)
{
kDebug() << "Metadata for file" << finfo.fileName() << "written to file.";
qDebug() << "Metadata for file" << finfo.fileName() << "written to file.";
}
}
if (writeToSidecar || (writeToSidecarIfFileNotPossible && !writtenToFile))
{
kDebug() << "Will write XMP sidecar for file" << givenFileInfo.fileName();
qDebug() << "Will write XMP sidecar for file" << givenFileInfo.fileName();
writtenToSidecar = d->saveToXMPSidecar(imageFilePath);
if (writtenToSidecar)
{
kDebug() << "Metadata for file '" << givenFileInfo.fileName() << "' written to XMP sidecar.";
qDebug() << "Metadata for file '" << givenFileInfo.fileName() << "' written to XMP sidecar.";
}
}
......@@ -461,7 +461,7 @@ bool KExiv2::applyChanges() const
{
if (d->filePath.isEmpty())
{
kDebug() << "Failed to apply changes: file path is empty!";
qDebug() << "Failed to apply changes: file path is empty!";
return false;
}
......
......@@ -85,7 +85,7 @@ bool KExiv2::Private::saveToXMPSidecar(const QFileInfo& finfo) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
return false;
}
}
......@@ -94,7 +94,7 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
{
if (!finfo.isWritable())
{
kDebug() << "File '" << finfo.fileName().toAscii().constData() << "' is read only. Metadata not written.";
qDebug() << "File '" << finfo.fileName().toAscii().constData() << "' is read only. Metadata not written.";
return false;
}
......@@ -122,7 +122,7 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
if (!writeRawFiles && (rawTiffBasedSupported.contains(ext) || rawTiffBasedNotSupported.contains(ext)) )
{
kDebug() << finfo.fileName()
qDebug() << finfo.fileName()
<< "is a TIFF based RAW file, writing to such a file is disabled by current settings.";
return false;
}
......@@ -130,20 +130,20 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
/*
if (rawTiffBasedNotSupported.contains(ext))
{
kDebug() << finfo.fileName()
qDebug() << finfo.fileName()
<< "is TIFF based RAW file not yet supported. Metadata not saved.";
return false;
}
if (rawTiffBasedSupported.contains(ext) && !writeRawFiles)
{
kDebug() << finfo.fileName()
qDebug() << finfo.fileName()
<< "is TIFF based RAW file supported but writing mode is disabled. "
<< "Metadata not saved.";
return false;
}
kDebug() << "File Extension: " << ext << " is supported for writing mode";
qDebug() << "File Extension: " << ext << " is supported for writing mode";
bool ret = false;
*/
......@@ -161,7 +161,7 @@ bool KExiv2::Private::saveToFile(const QFileInfo& finfo) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
return false;
}
}
......@@ -269,12 +269,12 @@ bool KExiv2::Private::saveOperations(const QFileInfo& finfo, Exiv2::Image::AutoP
if (!wroteComment && !wroteEXIF && !wroteIPTC && !wroteXMP)
{
kDebug() << "Writing metadata is not supported for file" << finfo.fileName();
qDebug() << "Writing metadata is not supported for file" << finfo.fileName();
return false;
}
else if (!wroteEXIF || !wroteIPTC || !wroteXMP)
{
kDebug() << "Support for writing metadata is limited for file" << finfo.fileName()
qDebug() << "Support for writing metadata is limited for file" << finfo.fileName()
<< "EXIF" << wroteEXIF << "IPTC" << wroteIPTC << "XMP" << wroteXMP;
}
......@@ -311,7 +311,7 @@ bool KExiv2::Private::saveOperations(const QFileInfo& finfo, Exiv2::Image::AutoP
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -330,13 +330,13 @@ void KExiv2Data::Private::clear()
void KExiv2::Private::printExiv2ExceptionError(const QString& msg, Exiv2::Error& e)
{
std::string s(e.what());
kError() << msg.toAscii().constData() << " (Error #"
qCritical() << msg.toAscii().constData() << " (Error #"
<< e.code() << ": " << s.c_str();
}
void KExiv2::Private::printExiv2MessageHandler(int lvl, const char* msg)
{
kDebug() << "Exiv2 (" << lvl << ") : " << msg;
qDebug() << "Exiv2 (" << lvl << ") : " << msg;
}
QString KExiv2::Private::convertCommentValue(const Exiv2::Exifdatum& exifDatum) const
......@@ -388,7 +388,7 @@ QString KExiv2::Private::convertCommentValue(const Exiv2::Exifdatum& exifDatum)
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "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());
kError() << "Cannot check Comment access mode using Exiv2 (Error #"
qCritical() << "Cannot check Comment access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "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());
kError() << "Cannot check Exif access mode using Exiv2 (Error #"
qCritical() << "Cannot check Exif access mode using Exiv2 (Error #"
<< e.code() << ": " << s.c_str() << ")";
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -83,7 +83,7 @@ bool KExiv2::clearExif() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -117,13 +117,13 @@ QByteArray KExiv2::getExifEncoded(bool addExifHeader) const
catch( Exiv2::Error& e )
{
if (!d->filePath.isEmpty())
kDebug() << "From file " << d->filePath.toAscii().constData();
qDebug() << "From file " << d->filePath.toAscii().constData();
d->printExiv2ExceptionError("Cannot get Exif data using Exiv2 ", e);
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "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())
kError() << "From file " << d->filePath.toAscii().constData();
qCritical() << "From file " << d->filePath.toAscii().constData();
d->printExiv2ExceptionError("Cannot set Exif data using Exiv2 ", e);
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -222,7 +222,7 @@ KExiv2::MetaDataMap KExiv2::getExifTagsDataList(const QStringList& exifKeysFilte
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return MetaDataMap();
......@@ -274,7 +274,7 @@ QString KExiv2::getExifComment() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QString();
......@@ -338,7 +338,7 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -359,7 +359,7 @@ QString KExiv2::getExifTagTitle(const char* exifTagName)
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QString();
......@@ -380,7 +380,7 @@ QString KExiv2::getExifTagDescription(const char* exifTagName)
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QString();
......@@ -408,7 +408,7 @@ bool KExiv2::removeExifTag(const char* exifTagName, bool setProgramName) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -437,7 +437,7 @@ bool KExiv2::getExifTagRational(const char* exifTagName, long int& num, long int
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -459,7 +459,7 @@ bool KExiv2::setExifTagLong(const char* exifTagName, long val, bool setProgramNa
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -481,7 +481,7 @@ bool KExiv2::setExifTagRational(const char* exifTagName, long int num, long int
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -507,7 +507,7 @@ bool KExiv2::setExifTagData(const char* exifTagName, const QByteArray& data, boo
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -572,7 +572,7 @@ bool KExiv2::setExifTagVariant(const char* exifTagName, const QVariant& val,
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -669,7 +669,7 @@ QString KExiv2::createExifUserStringFromValue(const char* exifTagName, const QVa
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QString();
......@@ -701,7 +701,7 @@ bool KExiv2::getExifTagLong(const char* exifTagName, long& val, int component) c
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -732,7 +732,7 @@ QByteArray KExiv2::getExifTagData(const char* exifTagName) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QByteArray();
......@@ -818,7 +818,7 @@ QVariant KExiv2::getExifTagVariant(const char* exifTagName, bool rationalAsListO
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QVariant();
......@@ -851,7 +851,7 @@ QString KExiv2::getExifTagString(const char* exifTagName, bool escapeCR) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QString();
......@@ -873,7 +873,7 @@ bool KExiv2::setExifTagString(const char* exifTagName, const QString& value, boo
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -907,7 +907,7 @@ QImage KExiv2::getExifThumbnail(bool fixOrientation) const
if (it != exifData.end() && it->count())
{
long orientation = it->toLong();
kDebug() << "Exif Thumbnail Orientation: " << (int)orientation;
qDebug() << "Exif Thumbnail Orientation: " << (int)orientation;
rotateExifQImage(thumbnail, (ImageOrientation)orientation);
}
......@@ -921,7 +921,7 @@ QImage KExiv2::getExifThumbnail(bool fixOrientation) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return thumbnail;
......@@ -966,7 +966,7 @@ bool KExiv2::setExifThumbnail(const QImage& thumbImage, bool setProgramName) con
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -1025,7 +1025,7 @@ bool KExiv2::setTiffThumbnail(const QImage& thumbImage, bool setProgramName) con
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -1046,7 +1046,7 @@ bool KExiv2::removeExifThumbnail() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -1098,7 +1098,7 @@ KExiv2::TagsMap KExiv2::getStdExifTagsList() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return TagsMap();
......@@ -1151,7 +1151,7 @@ KExiv2::TagsMap KExiv2::getMakernoteTagsList() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return TagsMap();
......
......@@ -132,7 +132,7 @@ bool KExiv2::getGPSLatitudeNumber(double* const latitude) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -228,7 +228,7 @@ bool KExiv2::getGPSLongitudeNumber(double* const longitude) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -302,7 +302,7 @@ bool KExiv2::getGPSAltitude(double* const altitude) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -360,7 +360,7 @@ bool KExiv2::initializeGPSInfo(const bool setProgramName)
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -492,7 +492,7 @@ bool KExiv2::setGPSInfo(const double* const altitude, const double latitude, con
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -581,7 +581,7 @@ bool KExiv2::removeGPSInfo(const bool setProgramName)
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......
......@@ -88,7 +88,7 @@ bool KExiv2::setImageProgramId(const QString& program, const QString& version) c
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -181,7 +181,7 @@ QSize KExiv2::getImageDimensions() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return QSize();
......@@ -221,7 +221,7 @@ bool KExiv2::setImageDimensions(const QSize& size, bool setProgramName) const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return false;
......@@ -247,7 +247,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
orientation = str.toLong(&ok);
if (ok)
{
kDebug() << "Orientation => Xmp.tiff.Orientation => " << (int)orientation;
qDebug() << "Orientation => Xmp.tiff.Orientation => " << (int)orientation;
return (ImageOrientation)orientation;
}
}
......@@ -265,7 +265,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
if (it != exifData.end() && it->count())
{
orientation = it->toLong();
kDebug() << "Orientation => Exif.MinoltaCs7D.Rotation => " << (int)orientation;
qDebug() << "Orientation => Exif.MinoltaCs7D.Rotation => " << (int)orientation;
switch(orientation)
{
case 76:
......@@ -284,7 +284,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
if (it != exifData.end() && it->count())
{
orientation = it->toLong();
kDebug() << "Orientation => Exif.MinoltaCs5D.Rotation => " << (int)orientation;
qDebug() << "Orientation => Exif.MinoltaCs5D.Rotation => " << (int)orientation;
switch(orientation)
{
case 76:
......@@ -305,7 +305,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
if (it != exifData.end() && it->count())
{
orientation = it->toLong();
kDebug() << "Orientation => Exif.Image.Orientation => " << (int)orientation;
qDebug() << "Orientation => Exif.Image.Orientation => " << (int)orientation;
return (ImageOrientation)orientation;
}
......@@ -316,7 +316,7 @@ KExiv2::ImageOrientation KExiv2::getImageOrientation() const
}
catch(...)
{
kError() << "Default exception from Exiv2";
qCritical() << "Default exception from Exiv2";
}
return ORIENTATION_UNSPECIFIED;
......@@ -331,14 +331,14 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
{
if (orientation < ORIENTATION_UNSPECIFIED || orientation > ORIENTATION_ROT_270)
{
kDebug() << "Image orientation value is not correct!";
qDebug() << "Image orientation value is not correct!";
return false;
}
// Set Exif values.
d->exifMetadata()["Exif.Image.Orientation"] = static_cast<uint16_t>(orientation);
kDebug() << "Exif.Image.Orientation tag set to: " << (int)orientation;
qDebug() << "Exif.Image.Orientation tag set to: " << (int)orientation;
// Set Xmp values.
......@@ -360,7 +360,7 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
if (it != d->exifMetadata().end())
{
d->exifMetadata().erase(it);
kDebug() << "Removing Exif.MinoltaCs7D.Rotation tag";
qDebug() << "Removing Exif.MinoltaCs7D.Rotation tag";
}
Exiv2::ExifKey minoltaKey2("Exif.MinoltaCs5D.Rotation");
......@@ -368,7 +368,7 @@ bool KExiv2::setImageOrientation(ImageOrientation orientation, bool setProgramNa
if (it != d->exifMetadata().end())
{
d->exifMetadata().erase(it);
kDebug() << "Removing Exif.MinoltaCs5D.Rotation tag";