diff options
author | Thiago Macieira <thiago@kde.org> | 2006-04-10 10:49:36 +0000 |
---|---|---|
committer | Thiago Macieira <thiago@kde.org> | 2006-04-10 10:49:36 +0000 |
commit | 399c44a133b8a2a409e30c271be74c93c42d992b (patch) | |
tree | c4c83254c434deb8c6e6f857cb2d1bbf60366b88 /qt/examples | |
parent | 68b0f5235909a25a7cc4f679592fc7765e845cbf (diff) |
Merge from Subversion:
* qt/qt-dbus.qdocconf: Update Trolltech's webpage link to
something that exists (r526315)
* qt/qdbusinternalfilters.cpp: Correctly detect non-scriptable
slots/signals (r526316)
* qt/qdbusinternalfilters.cpp: Fix the setProperty call and
also return an unknown-method error if the parameters don't
match for org.freedesktop.DBus.Properties. (r526842)
* qt/examples/dbus.cpp: Allow passing of QVariants (r526843)
* qt/qdbusintegrator.cpp: Restore the proper order of
delivery: don't make method returns be delivered on priority
(r528150)
Diffstat (limited to 'qt/examples')
-rw-r--r-- | qt/examples/dbus.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/qt/examples/dbus.cpp b/qt/examples/dbus.cpp index e011381b..00172c62 100644 --- a/qt/examples/dbus.cpp +++ b/qt/examples/dbus.cpp @@ -213,11 +213,13 @@ void placeCall(const QString &service, const QString &path, const QString &inter QVariantList params; for (int i = 0; argc && i < types.count(); ++i) { int id = QVariant::nameToType(types.at(i)); - if (id == QVariant::UserType || id == QVariant::Map) { + if ((id == QVariant::UserType || id == QVariant::Map) && types.at(i) != "QVariant") { fprintf(stderr, "Sorry, can't pass arg of type %s yet\n", types.at(i).constData()); exit(1); } + if (id == QVariant::UserType) + id = QMetaType::type(types.at(i)); Q_ASSERT(id); @@ -227,7 +229,13 @@ void placeCall(const QString &service, const QString &path, const QString &inter else p = QString::fromLocal8Bit(argv[0]); - p.convert( QVariant::Type(id) ); + if (id < QVariant::UserType) + // avoid calling it for QVariant + p.convert( QVariant::Type(id) ); + else if (types.at(i) == "QVariant") { + QVariant tmp(id, p.constData()); + p = tmp; + } params += p; --argc; ++argv; |