Bug 399130 - Krita 4.1.2/4.1.3 fail to build with Qt 5.6
Summary: Krita 4.1.2/4.1.3 fail to build with Qt 5.6
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 4.1.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-27 08:07 UTC by Wolfgang Bauer
Modified: 2018-09-27 08:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bauer 2018-09-27 08:07:59 UTC
Trying to build Krita 4.1.2 and 4.1.3 with Qt 5.6.2 failed with this compiler error:
/home/abuild/rpmbuild/BUILD/krita-4.1.2/libs/ui/tool/KisToolChangesTracker.cpp: In member function 'KisToolChangesTrackerDataSP KisToolChangesTracker::lastState() const':
/home/abuild/rpmbuild/BUILD/krita-4.1.2/libs/ui/tool/KisToolChangesTracker.cpp:55:38: error: operands to ?: have different types 'QSharedPointer<KisToolChangesTrackerData>' and 'int'
     return !m_d->undoStack.isEmpty() ? m_d->undoStack.last() : 0;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

(that's with gcc7, 4.8 gave a more cryptic error "no match for ternary 'operator?:'")

I succeeded to build it with this change:
--- a/libs/ui/tool/KisToolChangesTracker.cpp
+++ b/libs/ui/tool/KisToolChangesTracker.cpp
@@ -52,7 +52,7 @@
 
 KisToolChangesTrackerDataSP KisToolChangesTracker::lastState() const
 {
-    return !m_d->undoStack.isEmpty() ? m_d->undoStack.last() : 0;
+    return !m_d->undoStack.isEmpty() ? m_d->undoStack.last() : static_cast<QSharedPointer<KisToolChangesTrackerData>>(0);
 }
 
 void KisToolChangesTracker::reset()
Comment 1 Halla Rempt 2018-09-27 08:09:15 UTC
Outch... I can push that, but I cannot postpone or recreate the release, and we're not going to release another 4.1.x, I'm afraid.
Comment 2 Halla Rempt 2018-09-27 08:18:04 UTC
Git commit 765cbfea64274f8fc405c78312f9cd1d117f3c90 by Boudewijn Rempt.
Committed on 27/09/2018 at 08:10.
Pushed by rempt into branch 'master'.

Fix building with Qt 5.6

M  +1    -1    libs/ui/tool/KisToolChangesTracker.cpp

https://commits.kde.org/krita/765cbfea64274f8fc405c78312f9cd1d117f3c90
Comment 3 Halla Rempt 2018-09-27 08:18:09 UTC
Git commit 90852da0a2ce60fe3ddaff819f2634ed55dbe943 by Boudewijn Rempt.
Committed on 27/09/2018 at 08:10.
Pushed by rempt into branch 'krita/4.1'.

Fix building with Qt 5.6

M  +1    -1    libs/ui/tool/KisToolChangesTracker.cpp

https://commits.kde.org/krita/90852da0a2ce60fe3ddaff819f2634ed55dbe943