[gconf/dev: 2/2] gconf-dbus: Support older daemon returning string for object path



commit 38f1973d58c65639fe83de7918b5c765933302cd
Author: Rob Bradford <rob linux intel com>
Date:   Mon Aug 15 15:24:27 2011 +0100

    gconf-dbus: Support older daemon returning string for object path
    
    Enhances: https://bugzilla.gnome.org/show_bug.cgi?id=655656

 gconf/gconf-dbus.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c
index 4b74bb8..335bc22 100644
--- a/gconf/gconf-dbus.c
+++ b/gconf/gconf-dbus.c
@@ -543,10 +543,23 @@ ensure_database (GConfEngine  *conf,
   if (gconf_handle_dbus_exception (reply, &error, err))
     return FALSE;
 
-  dbus_message_get_args (reply,
-			 NULL,
-			 DBUS_TYPE_OBJECT_PATH, &db,
-			 DBUS_TYPE_INVALID);
+  /* Previously we used "s" for the type here - this is for compatability
+   * See: https://bugzilla.gnome.org/show_bug.cgi?id=655656 */
+  if (g_str_equal (dbus_message_get_signature (reply), "s"))
+    {
+      g_warning (G_STRLOC ": Using compatability for older daemon");
+      dbus_message_get_args (reply,
+                             NULL,
+                             DBUS_TYPE_STRING, &db,
+                             DBUS_TYPE_INVALID);
+    }
+  else
+    {
+      dbus_message_get_args (reply,
+                             NULL,
+                             DBUS_TYPE_OBJECT_PATH, &db,
+                             DBUS_TYPE_INVALID);
+    }
 
   if (db == NULL)
     {



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