[glibmm] Add Gio::DBusConnection::get_sync() methods.



commit ea38b33e5856ac0310fab95ca26c5feffc9d207e
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Wed Dec 8 00:29:06 2010 -0500

    	Add Gio::DBusConnection::get_sync() methods.
    
    	* gio/src/dbusconnection.hg: Wrap get_sync() methods (cancellable and
    	non-cancellable versions).
    	* tools/m4/convert_gio.m4: Add enum conversion.

 ChangeLog                  |    8 ++++++++
 gio/src/dbusconnection.ccg |   14 ++++++++++++++
 gio/src/dbusconnection.hg  |    5 +++++
 tools/m4/convert_gio.m4    |    1 +
 4 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c18c42a..22b1b7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-08  José Alburquerque  <jaalburqu svn gnome org>
+
+	Add Gio::DBusConnection::get_sync() methods.
+
+	* gio/src/dbusconnection.hg: Wrap get_sync() methods (cancellable and
+	non-cancellable versions).
+	* tools/m4/convert_gio.m4: Add enum conversion.
+
 2010-12-05  José Alburquerque  <jaalburqu svn gnome org>
 
 	DBusConnection: Add missing _IGNORE().
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index ffa403f..6d73c5f 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -310,6 +310,20 @@ void DBusConnection::get(BusType bus_type, const SlotAsyncReady& slot)
     slot_copy);
 }
 
+//static
+Glib::RefPtr<DBusConnection> DBusConnection::get_sync(BusType bus_type)
+{
+  GError* gerror = 0;
+
+  GDBusConnection* result = g_bus_get_sync(static_cast<GBusType>(bus_type),
+    0, & gerror);
+
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+
+  return Glib::wrap(result);
+}
+
 void DBusConnection::close()
 {
   g_dbus_connection_close(gobj(), 0, 0, 0);
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index 084fc47..72607ac 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -162,6 +162,11 @@ public:
    */
   void get(BusType bus_type, const SlotAsyncReady& slot);
 
+  _WRAP_METHOD(static Glib::RefPtr<DBusConnection> get_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable), g_bus_get_sync, errthrow)
+
+  /// A Non-cancellable version of get_sync().
+  static Glib::RefPtr<DBusConnection> get_sync(BusType bus_type);
+
   /** @throw Glib::Error.
    */
   _WRAP_METHOD(static Glib::RefPtr<DBusConnection> get_finish(const Glib::RefPtr<AsyncResult>& res), g_bus_get_finish, errthrow)
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 36e0fe7..f7b75de 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -2,6 +2,7 @@ _CONV_ENUM(G,AppInfoCreateFlags)
 _CONV_ENUM(G,ApplicationFlags)
 _CONV_ENUM(G,AskPasswordFlags)
 _CONV_ENUM(G,CredentialsType)
+_CONV_ENUM(G,BusType)
 _CONV_ENUM(G,DataStreamByteOrder)
 _CONV_ENUM(G,DataStreamNewlineType)
 _CONV_ENUM(G,DBusCapabilityFlags)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]