[rygel-grilo] Fix type for ObjectPath keys



commit b0740a05401a23ca17cc66b90f8848651d9d5180
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Jun 17 09:17:56 2010 +0200

    Fix type for ObjectPath keys
    
    Some keys like Path and Parent were sending as string type instead of
    object_path type.

 lib/media-server2-server.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/lib/media-server2-server.c b/lib/media-server2-server.c
index f57aaeb..c4d5454 100644
--- a/lib/media-server2-server.c
+++ b/lib/media-server2-server.c
@@ -547,8 +547,16 @@ add_variant (DBusMessage *m,
 
   if (G_VALUE_HOLDS_STRING (v)) {
     str_value = g_value_get_string (v);
-    dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "s", &sub);
-    dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING, &str_value);
+    if (g_strcmp0 (key, "Path") == 0 ||
+        g_strcmp0 (key, "Parent") == 0 ||
+        g_strcmp0 (key, "Thumbnail") == 0 ||
+        g_strcmp0 (key, "AlbumArt") == 0) {
+      dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "o", &sub);
+      dbus_message_iter_append_basic (&sub, DBUS_TYPE_OBJECT_PATH, &str_value);
+    } else {
+      dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, "s", &sub);
+      dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING, &str_value);
+    }
     dbus_message_iter_close_container (iter, &sub);
   } else if (G_VALUE_HOLDS_INT (v)) {
     int_value = g_value_get_int (v);



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