diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-09 13:42:35 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-23 19:30:28 +0200 |
commit | 850d850c5af8ff77a4b9d53457ec6b1ba6c20cb3 (patch) | |
tree | 79af5853f71ca977c4e24eab609c0f07dcb04a7a /src/dbus/qdbusinterface.cpp | |
parent | be714154fa3f9dd7f1a44952293eee037793e383 (diff) |
Use QMetaType instead of integer based type ids
Change the implementation of Qt DBus to use QMetaType directly
instead of integer based type ids.
Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusinterface.cpp')
-rw-r--r-- | src/dbus/qdbusinterface.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp index e80dbdf0e0..3d6cf6c1f2 100644 --- a/src/dbus/qdbusinterface.cpp +++ b/src/dbus/qdbusinterface.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE static void copyArgument(void *to, int id, const QVariant &arg) { - if (id == arg.userType()) { + if (id == arg.metaType().id()) { switch (id) { case QMetaType::Bool: *reinterpret_cast<bool *>(to) = arg.toBool(); @@ -104,13 +104,13 @@ static void copyArgument(void *to, int id, const QVariant &arg) return; } - if (id == QDBusMetaTypeId::variant()) { + if (id == QDBusMetaTypeId::variant().id()) { *reinterpret_cast<QDBusVariant *>(to) = qvariant_cast<QDBusVariant>(arg); return; - } else if (id == QDBusMetaTypeId::objectpath()) { + } else if (id == QDBusMetaTypeId::objectpath().id()) { *reinterpret_cast<QDBusObjectPath *>(to) = qvariant_cast<QDBusObjectPath>(arg); return; - } else if (id == QDBusMetaTypeId::signature()) { + } else if (id == QDBusMetaTypeId::signature().id()) { *reinterpret_cast<QDBusSignature *>(to) = qvariant_cast<QDBusSignature>(arg); return; } @@ -121,14 +121,14 @@ static void copyArgument(void *to, int id, const QVariant &arg) } // if we got here, it's either an un-dermarshalled type or a mismatch - if (arg.userType() != QDBusMetaTypeId::argument()) { + if (arg.metaType() != QDBusMetaTypeId::argument()) { // it's a mismatch //qWarning? return; } // is this type registered? - const char *userSignature = QDBusMetaType::typeToSignature(id); + const char *userSignature = QDBusMetaType::typeToSignature(QMetaType(id)); if (!userSignature || !*userSignature) { // type not registered //qWarning? |