diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-09 15:10:58 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-09 16:13:03 (GMT) |
commit | 8fbdbd25015a4e5544dace3a77427861f0ca89f4 (patch) | |
tree | f123821ab3d89fb3feaee004284613bc31798f08 /src/dbus | |
parent | bbdf3d9a600acfcb6df19eb5317fcb79da79c2df (diff) | |
download | Qt-8fbdbd25015a4e5544dace3a77427861f0ca89f4.zip Qt-8fbdbd25015a4e5544dace3a77427861f0ca89f4.tar.gz Qt-8fbdbd25015a4e5544dace3a77427861f0ca89f4.tar.bz2 |
Let QDBusInterface work even if the introspection failed.
If the introspection failed, we won't have a meta object, meaning you
cannot connect to signals or invoke methods via the slot
mechanism. But you can still make calls.
The isValid() functionality is preserved because there is no owner for
this object.
Reviewed-By: Harald Fernengel
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusinterface.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp index 74b2a44..d0a693f 100644 --- a/src/dbus/qdbusinterface.cpp +++ b/src/dbus/qdbusinterface.cpp @@ -157,7 +157,9 @@ QDBusInterfacePrivate::QDBusInterfacePrivate(const QString &serv, const QString if (!metaObject) { // creation failed, somehow - isValid = false; + // most common causes are that the service doesn't exist or doesn't support introspection + // those are not fatal errors, so we continue working + if (!lastError.isValid()) lastError = QDBusError(QDBusError::InternalError, QLatin1String("Unknown error")); } @@ -232,7 +234,7 @@ QDBusInterface::~QDBusInterface() */ const QMetaObject *QDBusInterface::metaObject() const { - return d_func()->isValid ? d_func()->metaObject : &QDBusAbstractInterface::staticMetaObject; + return d_func()->metaObject ? d_func()->metaObject : &QDBusAbstractInterface::staticMetaObject; } /*! |