[glibmm] Gio::DBus::Connection::emit_signal(): Replace empty strings with NULL.



commit 383d92d5647457593114cb1028cc7e8663ed5c71
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Wed Jun 8 16:44:51 2011 -0400

    Gio::DBus::Connection::emit_signal(): Replace empty strings with NULL.
    
    	* gio/src/dbusconnection.ccg (emit_signal): Pass NULL to the C
    	function call where strings are empty allowing emitting signals to all
    	listeners.
    
    	Bug #645072 (Yannick Guesnet).

 ChangeLog                  |   10 ++++++++++
 gio/src/dbusconnection.ccg |    7 +++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e78a796..7485956 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-06-08  José Alburquerque  <jaalburqu svn gnome org>
+
+	Gio::DBus::Connection::emit_signal(): Replace empty strings with NULL.
+
+	* gio/src/dbusconnection.ccg (emit_signal): Pass NULL to the C
+	function call where strings are empty allowing emitting signals to all
+	listeners.
+
+	Bug #645072 (Yannick Guesnet).
+
 2011-06-07  José Alburquerque  <jaalburqu svn gnome org>
 
 	M4 Macros: Rename the _INITIALIZER macro to _INITIALIZATION.
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index f54a9fe..64e2424 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -762,8 +762,11 @@ void Connection::emit_signal(
   GError* gerror = 0;
 
   g_dbus_connection_emit_signal(gobj(),
-    destination_bus_name.c_str(), object_path.c_str(), interface_name.c_str(),
-    signal_name.c_str(), const_cast<GVariant*>(parameters.gobj()), &gerror);
+    (destination_bus_name.empty() ? 0 : destination_bus_name.c_str()),
+    (object_path.empty()? 0 : object_path.c_str()),
+    (interface_name.empty() ? 0 : interface_name.c_str()),
+    (signal_name.empty() ? 0 : signal_name.c_str()),
+    const_cast<GVariant*>(parameters.gobj()), &gerror);
 
   if(gerror)
     ::Glib::Error::throw_exception(gerror);



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