Bug 337472

Summary: Build failure against Qt5 git - KSycocaEntry * can't be converted to KMimeTypeFactory::MimeTypeEntry *
Product: [Frameworks and Libraries] frameworks-kservice Reporter: Axel Rasmussen <axel.rasmussen1>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: axel.rasmussen1, chaofeng111, kdelibs-bugs, kensington, simonandric5
Priority: NOR    
Version: 5.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: A full build log containing this error.
Proposed change which fixes this issue.

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.