dbus/glib dbus-gvalue-utils.c,1.6,1.7 dbus-gvalue.c,1.22,1.23

John Palmieri johnp at freedesktop.org
Mon Oct 17 21:38:07 PDT 2005


Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv18899/glib

Modified Files:
	dbus-gvalue-utils.c dbus-gvalue.c 
Log Message:
* glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdouble
and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT)
(gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble

* glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing
DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters
when constructing struct signatures

* python/_dbus.py (Bus): handle private connections using the
private keyword in the constructor. defaults to private=False
(Bus::close): new method to close a connection to the bus

* python/dbus_bindings.pyx (Connection::close): renamed method
was previously called disconnect
(bus_get): now supports getting a private connection

* python/proxies.py (ProxyMethod::__call__): check if ignore_reply
keyword is set to True.  if it is, execute the method without waiting
for a reply
(ProxyObject::_introspect_execute_queue): new method for executing
all the pending methods that were waiting for the introspect to
finish.  this is called when introspect either succeeds or fails
(ProxyObject::_introspect_error_handler): call queued methods



Index: dbus-gvalue-utils.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue-utils.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dbus-gvalue-utils.c	4 Aug 2005 15:49:30 -0000	1.6
+++ dbus-gvalue-utils.c	18 Oct 2005 04:38:04 -0000	1.7
@@ -299,6 +299,7 @@
     case G_TYPE_UINT:
       *func = NULL;
       return TRUE;
+    case G_TYPE_DOUBLE:
     case G_TYPE_STRING:
       *func = g_free;
       return TRUE;
@@ -308,6 +309,12 @@
 	  *func = unset_and_free_g_value;
 	  return TRUE;
 	}
+      else if (gtype == G_TYPE_VALUE_ARRAY)
+        {
+          *func = g_value_array_free;
+	  return TRUE;
+        }
+
       return FALSE;
     }
 }
@@ -387,6 +394,9 @@
     case G_TYPE_UINT:
       g_value_set_uint (value, GPOINTER_TO_UINT (instance));
       break;
+    case G_TYPE_DOUBLE:
+      g_value_set_double (value, *(gdouble *) instance);
+      break;
     case G_TYPE_STRING:
       g_value_set_static_string (value, instance);
       break;
@@ -426,6 +436,13 @@
     case G_TYPE_UINT:
       return GUINT_TO_POINTER (g_value_get_uint (value));
       break;
+    case G_TYPE_DOUBLE:
+      {
+        gdouble *p = (gdouble *) g_malloc0 (sizeof (gdouble));
+        *p = g_value_get_double (value);
+        return (gpointer) p;
+      }
+      break;
     case G_TYPE_STRING:
       return (gpointer) g_value_get_string (value);
       break;

Index: dbus-gvalue.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- dbus-gvalue.c	5 Oct 2005 20:43:46 -0000	1.22
+++ dbus-gvalue.c	18 Oct 2005 04:38:04 -0000	1.23
@@ -402,7 +402,7 @@
 
       array = g_value_get_boxed (val);
       
-      str = g_string_new ("");
+      str = g_string_new (DBUS_STRUCT_BEGIN_CHAR_AS_STRING);
       for (i = 0; i < array->n_values; i++)
 	{
 	  char *sig;
@@ -410,6 +410,8 @@
 	  g_string_append (str, sig);
 	  g_free (sig);
 	}
+      g_string_append (str, DBUS_STRUCT_END_CHAR_AS_STRING);
+      
       return g_string_free (str, FALSE);
     }
   else



More information about the dbus-commit mailing list