From 31843c4a7c4eb71cf30f21d6713d020503d658fc Mon Sep 17 00:00:00 2001 From: pdurante Date: Fri, 6 Jul 2007 11:02:01 +0000 Subject: [PATCH] * Added a method to register a new connection with its message bus (Naveen Verma) git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@11869 30a43799-04e7-0310-8b2b-ea0d24f86d0e --- include/dbus-c++/connection.h | 2 ++ src/connection.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/dbus-c++/connection.h b/include/dbus-c++/connection.h index 614c41e..62a95b9 100644 --- a/include/dbus-c++/connection.h +++ b/include/dbus-c++/connection.h @@ -85,6 +85,8 @@ public: const char* unique_name() const; + bool register_bus(); + bool connected() const; void disconnect(); diff --git a/src/connection.cpp b/src/connection.cpp index ba2c6d9..d587835 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -262,6 +262,17 @@ bool Connection::operator == ( const Connection& c ) const return _pvt->conn == c._pvt->conn; } +bool Connection::register_bus() +{ + InternalError e; + + bool r = dbus_bus_register(_pvt->conn, e); + + if(e) throw (e); + + return r; +} + bool Connection::connected() const { return dbus_connection_get_is_connected(_pvt->conn); @@ -396,3 +407,4 @@ bool Connection::start_service( const char* name, unsigned long flags ) return b; } +