Bug 359658 - Compilation of preprocesstask.cpp fails if QT_NO_CAST_FROM_ASCII is defined
Summary: Compilation of preprocesstask.cpp fails if QT_NO_CAST_FROM_ASCII is defined
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Compilation (show other bugs)
Version: 5.0.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 01:37 UTC by thisco
Modified: 2017-08-19 20:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.0
Sentry Crash Report:


Attachments
qt-no-cast-from-ascii.patch (718 bytes, patch)
2016-02-22 01:39 UTC, thisco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thisco 2016-02-22 01:37:50 UTC
Found this problem today while trying to compile the digikam-9999 ebuild (git master) on my Gentoo system. Apparently, QT_NO_CAST_FROM_ASCII is defined on my side, causing the QString(const * char) c'tor to be private. As a consequence I was not able to compile preprocesstask.cpp without modifying it, such that QImg::save(const QString&, FORMAT, DImgLoaderObserver* const) gets called in PreProcessTask::computePreview(const QUrl& inUrl) instead. The patch is included in the "Additional Information" section.

Reproducible: Always




diff --git a/utilities/assistants/panorama/tasks/preprocesstask.cpp b/utilities/assistants/panorama/tasks/preprocesstask.cpp
index 8efc607..49f9972 100644
--- a/utilities/assistants/panorama/tasks/preprocesstask.cpp
+++ b/utilities/assistants/panorama/tasks/preprocesstask.cpp
@@ -133,7 +133,7 @@ bool PreProcessTask::computePreview(const QUrl& inUrl)
     if (img.load(inUrl.toLocalFile()))
     {
         DImg preview = img.smoothScale(1280, 1024, Qt::KeepAspectRatio);
-        bool saved   = preview.save(outUrl.toLocalFile(), "JPG");
+       bool saved   = preview.save(outUrl.toLocalFile(), Digikam::DImg::FORMAT::JPEG);
 
         // save exif information also to preview image for auto rotation
         if (saved)
Comment 1 thisco 2016-02-22 01:39:37 UTC
Created attachment 97347 [details]
qt-no-cast-from-ascii.patch
Comment 2 thisco 2016-02-22 01:42:16 UTC
Added the patch as an attachment as well now. Sorry for the inconvenience, but I did not find an attachment field in the first form, hence I added it as "Additional Information" ...
Comment 3 Maik Qualmann 2016-02-22 07:09:36 UTC
Git commit b0f728ed31de2ebebe68394f856df0be388d3d04 by Maik Qualmann.
Committed on 22/02/2016 at 07:07.
Pushed by mqualmann into branch 'master'.

apply patch #97347 to correct DImg save format option
FIXED-IN: 5.0.0

M  +2    -2    NEWS
M  +1    -1    utilities/assistants/panorama/tasks/preprocesstask.cpp

http://commits.kde.org/digikam/b0f728ed31de2ebebe68394f856df0be388d3d04