From 259388157c3b9541dc24e2fcb08a404c29e9d19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 26 Jan 2012 16:54:43 +0100 Subject: Remove qDBusNameToTypeId function. The function is redundant and can be replaced by QMetaType::type(). Change-Id: I131a7fd285a60d8bd0f3b958668a43bd5da2d6c4 Reviewed-by: Jonas Gastal Reviewed-by: Thiago Macieira --- src/dbus/qdbusinternalfilters.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/dbus/qdbusinternalfilters.cpp') 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); -- cgit v1.2.3