[rygel] external: Minor refactor of ItemFactory.create()



commit ba705b18280901878917e39e7e41fe253712fa7b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jun 16 17:02:59 2010 +0300

    external: Minor refactor of ItemFactory.create()

 .../external/rygel-external-item-factory.vala      |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/external/rygel-external-item-factory.vala b/src/plugins/external/rygel-external-item-factory.vala
index 906e30c..3f99692 100644
--- a/src/plugins/external/rygel-external-item-factory.vala
+++ b/src/plugins/external/rygel-external-item-factory.vala
@@ -38,21 +38,20 @@ public class Rygel.ExternalItemFactory {
                                    string                   host_ip,
                                    MediaContainer           parent)
                                    throws GLib.Error {
-        var item = new MediaItem (id,
-                                  parent,
-                                  title,
-                                  "Unknown"); /* UPnP Class Unknown atm */
+        string upnp_class;
 
         if (type.has_prefix ("audio")) {
-            item.upnp_class = MediaItem.AUDIO_CLASS;
+            upnp_class = MediaItem.AUDIO_CLASS;
         } else if (type.has_prefix ("music")) {
-            item.upnp_class = MediaItem.MUSIC_CLASS;
+            upnp_class = MediaItem.MUSIC_CLASS;
         } else if (type.has_prefix ("video")) {
-            item.upnp_class = MediaItem.VIDEO_CLASS;
+            upnp_class = MediaItem.VIDEO_CLASS;
         } else {
-            item.upnp_class = MediaItem.IMAGE_CLASS;
+            upnp_class = MediaItem.IMAGE_CLASS;
         }
 
+        var item = new MediaItem (id, parent, title, upnp_class);
+
         var value = props.lookup ("MIMEType");
         item.mime_type = value.get_string ();
 



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