Bug 337472 - Build failure against Qt5 git - KSycocaEntry * can't be converted to KMimeTypeFactory::MimeTypeEntry *
Summary: Build failure against Qt5 git - KSycocaEntry * can't be converted to KMimeTyp...
Alias: None
Product: frameworks-kservice
Classification: Unclassified
Component: general (show other bugs)
Version: 5.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
Depends on:
Reported: 2014-07-15 17:55 UTC by Axel Rasmussen
Modified: 2015-04-05 12:30 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:

A full build log containing this error. (52.00 KB, text/x-log)
2014-07-15 17:55 UTC, Axel Rasmussen
Proposed change which fixes this issue. (1.17 KB, patch)
2014-07-15 20:22 UTC, Axel Rasmussen

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Rasmussen 2014-07-15 17:55:03 UTC
When building KService-5.0.0 against Qt5 from git, one gets a build failure involving an invalid pointer type conversion. I have attached a build log from my machine, running Gentoo Linux.

The issue lies in KMimeTypeFactory::allMimeTypes() (line 116 in kservice/src/services/kmimetypefactory.cpp). The code tries to construct a MimeTypeEntry::Ptr from a KSycocaEntry, where MimeTypeEntry::Ptr is:

typedef QExplicitlySharedDataPointer<MimeTypeEntry> Ptr;
Comment 1 Axel Rasmussen 2014-07-15 17:55:34 UTC
Created attachment 87742 [details]
A full build log containing this error.
Comment 2 Axel Rasmussen 2014-07-15 19:25:23 UTC
I have investigated further, and this bug is caused by Qt commit e112c2e (https://qt.gitorious.org/qt/qtbase/commit/e112c2ee20f89f288a4f0a13827f0b64067096f0). There seem to be two possible fixes:

1. Change all KDE code which depended on the old static_cast functionality to perform the static_cast ourselves, instead of relying on Qt to do it.

2. Update e.g. KDECompilerSettings.cmake to define QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST to re-enable the static_cast code in Qt.
Comment 3 Axel Rasmussen 2014-07-15 20:22:24 UTC
Created attachment 87746 [details]
Proposed change which fixes this issue.
Comment 4 Chao Feng 2015-04-05 12:30:33 UTC
static_cast is added.