summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusinternalfilters.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-01-26 16:54:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-27 10:51:40 +0100
commit259388157c3b9541dc24e2fcb08a404c29e9d19f (patch)
tree10e47707685142e97595e4852cc6a1ab3a5cebf2 /src/dbus/qdbusinternalfilters.cpp
parentbd5881b460cf2c42415ff3ff779f0c366c85a403 (diff)
Remove qDBusNameToTypeId function.
The function is redundant and can be replaced by QMetaType::type(). Change-Id: I131a7fd285a60d8bd0f3b958668a43bd5da2d6c4 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusinternalfilters.cpp')
-rw-r--r--src/dbus/qdbusinternalfilters.cpp20
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);