diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-01-28 15:40:51 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-06 19:25:48 (GMT) |
commit | fd2e832657a38d4dba9b86ce190f7736a837d53d (patch) | |
tree | 31d6fa6bf0596b4bf175d1e1f5ec4557592c3220 /tools/qdbus | |
parent | 4f29c5d5381a76f24e13628da3edc5b19c6b1cd2 (diff) | |
download | Qt-fd2e832657a38d4dba9b86ce190f7736a837d53d.zip Qt-fd2e832657a38d4dba9b86ce190f7736a837d53d.tar.gz Qt-fd2e832657a38d4dba9b86ce190f7736a837d53d.tar.bz2 |
Make qdbus show all types, even those that it doesn't know about
Diffstat (limited to 'tools/qdbus')
-rw-r--r-- | tools/qdbus/qdbus/qdbus.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index 6ec8224..4e5cf9a 100644 --- a/tools/qdbus/qdbus/qdbus.cpp +++ b/tools/qdbus/qdbus/qdbus.cpp @@ -50,6 +50,8 @@ #include <QtDBus/QtDBus> #include <private/qdbusutil_p.h> +Q_DBUS_EXPORT extern bool qt_dbus_metaobject_skip_annotations; + static QDBusConnection connection(QLatin1String("")); static bool printArgumentsLiterally = false; @@ -99,7 +101,7 @@ static void printArg(const QVariant &v) else if (arg.currentSignature() == QLatin1String("a{sv}")) printArg(qdbus_cast<QVariantMap>(arg)); else - printf("qdbus: I don't know how to display an argument of type '%s'\n", + printf("qdbus: I don't know how to display an argument of type '%s', run with --literal.\n", qPrintable(arg.currentSignature())); } else { printf("%s\n", qPrintable(v.toString())); @@ -311,7 +313,11 @@ static int placeCall(const QString &service, const QString &path, const QString int id = QVariant::nameToType(types.at(i)); if (id == QVariant::UserType) id = QMetaType::type(types.at(i)); - Q_ASSERT(id); + if (!id) { + fprintf(stderr, "Cannot call method '%s' because type '%s' is unknown to this tool\n", + qPrintable(member), types.at(i).constData()); + return 1; + } QVariant p; QString argument; @@ -435,6 +441,7 @@ static void printAllServices(QDBusConnectionInterface *bus) int main(int argc, char **argv) { + qt_dbus_metaobject_skip_annotations = true; QCoreApplication app(argc, argv); QStringList args = app.arguments(); args.takeFirst(); |