Adapt QtDBus to QVariant property type change
Commit 00c8984b4e48b2a7eadfee6c3cd0cbb19f586118 changed other parts of Qt to use QMetaType::QVariant, not 0xff, as the type for QVariant properties. QtDBus should check for that type, and also use it for QDBusVariant properties. Change-Id: I21d81b59754ae44889766877a4c5066466b46d86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4ec2b37542
commit
8bbb00e44e
@ -125,7 +125,7 @@ void QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, QVariant &
|
|||||||
|
|
||||||
// is this metatype registered?
|
// is this metatype registered?
|
||||||
const char *expectedSignature = "";
|
const char *expectedSignature = "";
|
||||||
if (mp.type() != 0xff) {
|
if (int(mp.type()) != QMetaType::QVariant) {
|
||||||
expectedSignature = QDBusMetaType::typeToSignature(where.userType());
|
expectedSignature = QDBusMetaType::typeToSignature(where.userType());
|
||||||
if (expectedSignature == 0) {
|
if (expectedSignature == 0) {
|
||||||
qWarning("QDBusAbstractInterface: type %s must be registered with QtDBus before it can be "
|
qWarning("QDBusAbstractInterface: type %s must be registered with QtDBus before it can be "
|
||||||
@ -164,7 +164,7 @@ void QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, QVariant &
|
|||||||
const char *foundType = 0;
|
const char *foundType = 0;
|
||||||
QVariant value = qvariant_cast<QDBusVariant>(reply.arguments().at(0)).variant();
|
QVariant value = qvariant_cast<QDBusVariant>(reply.arguments().at(0)).variant();
|
||||||
|
|
||||||
if (value.userType() == where.userType() || mp.type() == 0xff
|
if (value.userType() == where.userType() || mp.userType() == QMetaType::QVariant
|
||||||
|| (expectedSignature[0] == 'v' && expectedSignature[1] == '\0')) {
|
|| (expectedSignature[0] == 'v' && expectedSignature[1] == '\0')) {
|
||||||
// simple match
|
// simple match
|
||||||
where = value;
|
where = value;
|
||||||
|
@ -348,7 +348,7 @@ void QDBusMetaObjectGenerator::parseProperties()
|
|||||||
mp.flags |= Writable;
|
mp.flags |= Writable;
|
||||||
|
|
||||||
if (mp.typeName == "QDBusVariant")
|
if (mp.typeName == "QDBusVariant")
|
||||||
mp.flags |= 0xff << 24;
|
mp.flags |= QMetaType::QVariant << 24;
|
||||||
else if (mp.type < 0xff)
|
else if (mp.type < 0xff)
|
||||||
// encode the type in the flags
|
// encode the type in the flags
|
||||||
mp.flags |= mp.type << 24;
|
mp.flags |= mp.type << 24;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user