summaryrefslogtreecommitdiffstats
path: root/qt/qdbusinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt/qdbusinterface.cpp')
-rw-r--r--qt/qdbusinterface.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/qt/qdbusinterface.cpp b/qt/qdbusinterface.cpp
index ff8fdc95..48b1011c 100644
--- a/qt/qdbusinterface.cpp
+++ b/qt/qdbusinterface.cpp
@@ -58,6 +58,19 @@ QDBusInterface::~QDBusInterface()
}
/*!
+ Returns true if this is a valid reference to a remote object. It returns false if
+ there was an error during the creation of this interface (for instance, if the remote
+ application does not exist).
+
+ Note: when dealing with remote objects, it is not always possible to determine if it
+ exists when creating a QDBusInterface or QDBusInterfacePtr object.
+*/
+bool QDBusInterface::isValid() const
+{
+ return d_func()->isValid;
+}
+
+/*!
\internal
Overrides QObject::metaObject to return our own copy.
*/
@@ -238,13 +251,13 @@ int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv)
return id;
}
-QDBusRef::QDBusRef(QDBusConnection &conn, const QString &service, const QString &path,
+QDBusInterfacePtr::QDBusInterfacePtr(QDBusConnection &conn, const QString &service, const QString &path,
const QString &interface)
: d(conn.findInterface(service, path, interface))
{
}
-QDBusRef::QDBusRef(const QString &service, const QString &path, const QString &interface)
+QDBusInterfacePtr::QDBusInterfacePtr(const QString &service, const QString &path, const QString &interface)
: d(QDBus::sessionBus().findInterface(service, path, interface))
{
}