[rygel] gstlaunch: Refactor and beautify!



commit 34088c5036c1e7ccbb97cd5f4acf7b9ffd32f6f9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Sep 21 16:01:57 2009 +0300

    gstlaunch: Refactor and beautify!

 .../gstlaunch/rygel-gstlaunch-root-container.vala  |   36 ++++++++++++-------
 1 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/src/plugins/gstlaunch/rygel-gstlaunch-root-container.vala b/src/plugins/gstlaunch/rygel-gstlaunch-root-container.vala
index 355d331..cd63c73 100644
--- a/src/plugins/gstlaunch/rygel-gstlaunch-root-container.vala
+++ b/src/plugins/gstlaunch/rygel-gstlaunch-root-container.vala
@@ -39,26 +39,36 @@ public class Rygel.GstLaunchRootContainer : SimpleContainer {
         base.root (title);
 
         try {
-          config = MetaConfig.get_default ();
-          var item_names = config.get_string_list (CONFIG_GROUP, ITEM_NAMES);
-          foreach (string name in item_names)
-            add_launch_item (name);
+            config = MetaConfig.get_default ();
+
+            var item_names = config.get_string_list (CONFIG_GROUP, ITEM_NAMES);
+            foreach (var name in item_names) {
+                add_launch_item (name);
+            }
         } catch (Error err) {
-          debug ("GstLaunch init failed: %s", err.message);
+            debug ("GstLaunch init failed: %s", err.message);
         }
 
         this.child_count = this.children.size;
     }
 
     void add_launch_item (string name) {
-      try {
-        string title = config.get_string (CONFIG_GROUP, "%s_title".printf (name));
-        string mime_type = config.get_string (CONFIG_GROUP, "%s_mime".printf (name));
-        string launch_line = config.get_string (CONFIG_GROUP, "%s_launch".printf (name));
-        this.children.add (new GstLaunchItem (name, this, title, mime_type, launch_line));
-      } catch (GLib.Error err) {
-        debug ("GstLaunch failed item '%s': %s", name, err.message);
-      }
+        try {
+            var title = config.get_string (CONFIG_GROUP,
+                                           "%s_title".printf (name));
+            var mime_type = config.get_string (CONFIG_GROUP,
+                                               "%s_mime".printf (name));
+            var launch_line = config.get_string (CONFIG_GROUP,
+                                                 "%s_launch".printf (name));
+
+            this.children.add (new GstLaunchItem (name,
+                                                  this,
+                                                  title,
+                                                  mime_type,
+                                                  launch_line));
+        } catch (GLib.Error err) {
+            debug ("GstLaunch failed item '%s': %s", name, err.message);
+        }
     }
 }
 



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