Details
Description
My application receives these errors:
=======
QFATAL : SsoTestClient::queryAvailableMetods() QDBusPendingReply: type void is not registered with QtDBus
FAIL! : SsoTestClient::queryAvailableMetods() Received a fatal error.
=======
The code used to build fine in MeeGo / Harmattan, but now I'm testing some code on a 64bit machine; it may be that the issue is only reproducible on 64 bit environments.
Near the end of QDBusPendingCallPrivate::setReplyCallback() there's this:
=======
// QList<int> is actually a vector
// kids, don't try this at home
setMetaTypes(count, count ? &metaTypes.at(1) : 0);
=======
When debugging, I saw that metaTypes contained three values: 0, 206 and 9. But the array received by setMetaTypes was 206, 0, 9 (but the length is 2, so the last number would be ignored) – that is, an element with value 0 appears in between of the array elements, causing the error above.
I locally fixed the issue like this:
=======
@@ -180,9 +181,12 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
if (metaTypes.at(count) == QDBusMetaTypeId::message)
--count;
- // QList<int> is actually a vector
- // kids, don't try this at home
- setMetaTypes(count, count ? &metaTypes.at(1) : 0);
+ if (count == 0) { + setMetaTypes(count, 0); + }else
{ + QVector<int> types = QVector<int>::fromList(metaTypes); + setMetaTypes(count, types.constData() + 1); + }return true;
}
=======
I'm going to propose the patch above for merging – but any hint on how to solve the problem from my application while the patch is not integrated into Qt will be greatly appreciated!