diff options
Diffstat (limited to 'src/dbus/qdbusinternalfilters.cpp')
-rw-r--r-- | src/dbus/qdbusinternalfilters.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp index 58a048ed95..30a9c8d69f 100644 --- a/src/dbus/qdbusinternalfilters.cpp +++ b/src/dbus/qdbusinternalfilters.cpp @@ -324,19 +324,15 @@ static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant // we found our property // do we have the right type? - int id = mp.type(); - if (id == QVariant::UserType) { - // dynamic type - id = qDBusNameToTypeId(mp.typeName()); - if (id == -1) { - // type not registered? - qWarning("QDBusConnection: Unable to handle unregistered datatype '%s' for property '%s::%s'", - mp.typeName(), mo->className(), property_name.constData()); - return PropertyWriteFailed; - } + int id = mp.userType(); + if (!id){ + // type not registered or invalid / void? + qWarning("QDBusConnection: Unable to handle unregistered datatype '%s' for property '%s::%s'", + mp.typeName(), mo->className(), property_name.constData()); + return PropertyWriteFailed; } - if (id != 0xff && value.userType() == QDBusMetaTypeId::argument) { + if (id != QMetaType::QVariant && value.userType() == QDBusMetaTypeId::argument) { // we have to demarshall before writing void *null = 0; QVariant other(id, null); @@ -434,7 +430,7 @@ static QVariantMap readAllProperties(QObject *object, int flags) continue; // is it a registered property? - int typeId = qDBusNameToTypeId(mp.typeName()); + int typeId = mp.userType(); if (!typeId) continue; const char *signature = QDBusMetaType::typeToSignature(typeId); |