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; } +