summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-12-20 18:41:08 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-29 10:30:12 (GMT)
commita0690166164b7feb059164d2b587ed54fa675485 (patch)
treed254fe4740fe6ddbfde80f6bf2df83694d8ff10c
parenta8bf19019b3374eefaadb4e054d24089bc4fd5a4 (diff)
downloadQt-a0690166164b7feb059164d2b587ed54fa675485.zip
Qt-a0690166164b7feb059164d2b587ed54fa675485.tar.gz
Qt-a0690166164b7feb059164d2b587ed54fa675485.tar.bz2
Add a way to obtain the DBusConnection* pointer from a QDBusConnection
This is internal API and the behaviour may change without notice. In the future, I could use a different implementation without libdbus-1, so this pointer may be something different. The use of DBusConnection is also entirely implementation-defined, so keeping this connection around is entirely unsupported. You have been warned.
-rw-r--r--src/dbus/qdbusconnection.cpp15
-rw-r--r--src/dbus/qdbusconnection.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 3fb63eb..fe7f41e 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -873,6 +873,21 @@ QDBusConnectionInterface *QDBusConnection::interface() const
}
/*!
+ \internal
+ \since 4.8
+
+ Returns the internal, implementation-defined pointer for this
+ connection. Currently, this returns a DBusConnection* pointer,
+ without changing the reference count. It is the responsibility of
+ the caller to call dbus_connection_ref if it wants to store the
+ pointer.
+*/
+void *QDBusConnection::internalPointer() const
+{
+ return d ? d->connection : 0;
+}
+
+/*!
Returns true if this QDBusConnection object is connected.
*/
bool QDBusConnection::isConnected() const
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index ec59434..c0b9905 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -163,6 +163,8 @@ public:
QDBusConnectionInterface *interface() const;
+ void *internalPointer() const;
+
static QDBusConnection connectToBus(BusType type, const QString &name);
static QDBusConnection connectToBus(const QString &address, const QString &name);
static void disconnectFromBus(const QString &name);