[glibmm] DBusConnection: Fix some (useful) compilation warnings.



commit eade8b32ebe2f6e3493883969582fa482bc6cdc2
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Sep 14 10:13:24 2010 +0200

    DBusConnection: Fix some (useful) compilation warnings.
    
    * gio/src/dbusconnection.[hg|ccg]: IOStream constructors and create*()
      methods: Actually use the slot parameter.

 ChangeLog                  |    7 +++++++
 gio/src/dbusconnection.ccg |   29 +++++++++++++++++------------
 gio/src/dbusconnection.hg  |   10 ++++++----
 3 files changed, 30 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ddcb188..52d4e80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-09-14  Murray Cumming  <murrayc murrayc com>
 
+	DBusConnection: Fix some (useful) compilation warnings.
+
+	* gio/src/dbusconnection.[hg|ccg]: IOStream constructors and create*()
+  methods: Actually use the slot parameter.
+
+2010-09-14  Murray Cumming  <murrayc murrayc com>
+
 	giomm: Added some DBusMessage and NetworkAddress methods.
 
 	* gio/src/dbusmessage.hg: Added get_locked(), lock(), and copy().
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index b5b7eb7..0e65ef3 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -80,35 +80,40 @@ void DBusConnection::create(const Glib::RefPtr<IOStream>& stream,
   const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
+  // Note that this does not return anything, because it is async - see create_finish().
+
   // Create the connection, taking an extra reference without returning it.
   // The extra reference is taken so the connection is not destroyed when it
   // goes out of scope.  The finished connection will be returned in the slot
   // by calling create_finish().
   Glib::RefPtr<DBusConnection>(new DBusConnection(stream, guid, flags,
-    observer, cancellable))->reference();
+    observer, slot, cancellable))->reference();
+}
+
+Glib::RefPtr<DBusConnection> DBusConnection::create(
+  const Glib::RefPtr<IOStream>& stream,
+  const Glib::ustring& guid, DBusConnectionFlags flags,
+  const Glib::RefPtr<DBusAuthObserver>& observer,
+  const Glib::RefPtr<Cancellable>& cancellable)
+{
+  return Glib::RefPtr<DBusConnection>(new DBusConnection(stream, guid, flags,
+    observer, cancellable));
 }
 
+
 void DBusConnection::create_for_address(const Glib::ustring& address,
   DBusConnectionFlags flags, const Glib::RefPtr<DBusAuthObserver>& observer,
   const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
+  // Note that this does not return anything, because it is async - see create_finish().
+
   // Create the connection, taking an extra reference without returning it.
   // The extra reference is taken so the connection is not destroyed when it
   // goes out of scope.  The finished connection will be returned in the slot
   // by calling create_finish().
   Glib::RefPtr<DBusConnection>(new DBusConnection(address, flags,
-    observer, cancellable))->reference();
-}
-
-Glib::RefPtr<DBusConnection> DBusConnection::create(
-  const Glib::RefPtr<IOStream>& stream,
-  const Glib::ustring& guid, DBusConnectionFlags flags,
-  const Glib::RefPtr<DBusAuthObserver>& observer,
-  const Glib::RefPtr<Cancellable>& cancellable)
-{
-  return Glib::RefPtr<DBusConnection>(new DBusConnection(stream, guid, flags,
-    observer, cancellable));
+    observer, slot, cancellable))->reference();
 }
 
 Glib::RefPtr<DBusConnection> DBusConnection::create_for_address(
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index b82ac1e..7bb3b17 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -66,16 +66,18 @@ protected:
     const SlotAsyncReady& slot,
     const Glib::RefPtr<Cancellable>& cancellable);
 
-  DBusConnection(const Glib::ustring& address, DBusConnectionFlags flags,
+  DBusConnection(const Glib::RefPtr<IOStream>& stream,
+    const Glib::ustring& guid, DBusConnectionFlags flags,
     const Glib::RefPtr<DBusAuthObserver>& observer,
-    const SlotAsyncReady& slot,
     const Glib::RefPtr<Cancellable>& cancellable);
 
-  DBusConnection(const Glib::RefPtr<IOStream>& stream,
-    const Glib::ustring& guid, DBusConnectionFlags flags,
+  DBusConnection(const Glib::ustring& address, DBusConnectionFlags flags,
     const Glib::RefPtr<DBusAuthObserver>& observer,
+    const SlotAsyncReady& slot,
     const Glib::RefPtr<Cancellable>& cancellable);
 
+
+
   DBusConnection(const Glib::ustring& address, DBusConnectionFlags flags,
     const Glib::RefPtr<DBusAuthObserver>& observer,
     const Glib::RefPtr<Cancellable>& cancellable);



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