[rygel] core: Minor refactor of some RootDeviceFactory code



commit a827e0f8abf6c181c7a716408d8a767e09722902
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Mar 31 22:14:18 2010 +0300

    core: Minor refactor of some RootDeviceFactory code

 src/rygel/rygel-root-device-factory.vala |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala
index 70f8d1f..9822798 100644
--- a/src/rygel/rygel-root-device-factory.vala
+++ b/src/rygel/rygel-root-device-factory.vala
@@ -51,11 +51,12 @@ internal class Rygel.RootDeviceFactory {
     }
 
     public RootDevice create (Plugin plugin) throws GLib.Error {
-        string modified_desc = plugin.name + ".xml";
-        var desc_path = Path.build_filename (this.desc_dir, modified_desc);
+        var desc_path = Path.build_filename (this.desc_dir,
+                                             plugin.name + ".xml");
+        var template_path = plugin.desc_path;
 
         /* Create the description xml */
-        var doc = this.create_desc (plugin, desc_path);
+        var doc = this.create_desc (plugin, desc_path, template_path);
 
         return new RootDevice (this.context,
                                plugin,
@@ -65,18 +66,17 @@ internal class Rygel.RootDeviceFactory {
     }
 
     private XMLDoc create_desc (Plugin plugin,
-                                string desc_path) throws GLib.Error {
-        string path;
+                                string desc_path,
+                                string template_path) throws GLib.Error {
+        XMLDoc doc;
 
         if (this.check_path_exist (desc_path)) {
-            path = desc_path;
+            doc = new XMLDoc.from_path (desc_path);
         } else {
             /* Use the template */
-            path = plugin.desc_path;
+            doc = new XMLDoc.from_path (template_path);
         }
 
-        var doc = new XMLDoc.from_path (path);
-
         /* Modify description to include Plugin-specific stuff */
         this.prepare_desc_for_plugin (doc, plugin);
 



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