[rygel] Use GetAll to get all item props at once



commit df82fd5cc02260ccc201d2d02e9e7276a7d5fe82
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed May 13 17:01:33 2009 +0300

    Use GetAll to get all item props at once
---
 src/plugins/external/rygel-external-item.vala |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/plugins/external/rygel-external-item.vala b/src/plugins/external/rygel-external-item.vala
index 0f47da3..467c9a5 100644
--- a/src/plugins/external/rygel-external-item.vala
+++ b/src/plugins/external/rygel-external-item.vala
@@ -48,11 +48,14 @@ public class Rygel.ExternalItem : MediaItem {
                                                            object_path,
                                                            PROPS_IFACE);
 
-        Value value;
-        props.Get (OBJECT_IFACE, "display-name", out value);
+        HashTable<string,Value?> object_props = props.GetAll (OBJECT_IFACE);
+
+        var value = object_props.lookup ("display-name");
         this.title = parent.substitute_keywords (value.get_string ());
 
-        props.Get (ITEM_IFACE, "type", out value);
+        HashTable<string,Value?> item_props = props.GetAll (ITEM_IFACE);
+
+        value = item_props.lookup ("type");
         string type = value.get_string ();
         if (type == "audio") {
             this.upnp_class = MediaItem.AUDIO_CLASS;
@@ -64,10 +67,10 @@ public class Rygel.ExternalItem : MediaItem {
             this.upnp_class = MediaItem.IMAGE_CLASS;
         }
 
-        props.Get (ITEM_IFACE, "mime-type", out value);
+        value = item_props.lookup ("mime-type");
         this.mime_type = value.get_string ();
 
-        props.Get (ITEM_IFACE, "urls", out value);
+        value = item_props.lookup ("urls");
         weak string[] uris = (string[]) value.get_boxed ();
 
         for (var i = 0; uris[i] != null; i++) {



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