summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-06-21 19:14:01 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-06-23 11:03:47 (GMT)
commit59bd3bcd961fb3198dc9ba24996f7f9af67aeda3 (patch)
tree22bb06bd8f88513c0e64b56557d33b6445eee05b /src/dbus/qdbusconnection.cpp
parent45d2d36c9dbcbce403c78838ea52acd1ab111b68 (diff)
downloadQt-59bd3bcd961fb3198dc9ba24996f7f9af67aeda3.zip
Qt-59bd3bcd961fb3198dc9ba24996f7f9af67aeda3.tar.gz
Qt-59bd3bcd961fb3198dc9ba24996f7f9af67aeda3.tar.bz2
Add a function that returns the D-Bus local machine ID
Reviewed-by: Lars Knoll
Diffstat (limited to 'src/dbus/qdbusconnection.cpp')
-rw-r--r--src/dbus/qdbusconnection.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 6628ca3..94989f5 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -1123,6 +1123,27 @@ void QDBusConnectionPrivate::setBusService(const QDBusConnection &connection)
}
/*!
+ \since 4.8
+ Returns the local machine ID as known to the D-Bus system. Each
+ node or host that runs D-Bus has a unique identifier that can be
+ used to distinguish it from other hosts if they are sharing
+ resources like the filesystem.
+
+ Note that the local machine ID is not guaranteed to be persistent
+ across boots of the system, so this identifier should not be
+ stored in persistent storage (like the filesystem). It is
+ guaranteed to remain constant only during the lifetime of this
+ boot session.
+*/
+QByteArray QDBusConnection::localMachineId()
+{
+ char *dbus_machine_id = q_dbus_get_local_machine_id();
+ QByteArray result = dbus_machine_id;
+ q_dbus_free(dbus_machine_id);
+ return result;
+}
+
+/*!
\namespace QDBus
\inmodule QtDBus