[rygel] core: Simplify code by using File.get_child



commit a74a4648c8d60ee82b0d8b8cbac50ed9030774ad
Author: Jens Georg <mail jensge org>
Date:   Fri Feb 17 10:20:10 2012 +0200

    core: Simplify code by using File.get_child
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660477

 src/rygel/rygel-plugin-loader.vala |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/rygel/rygel-plugin-loader.vala b/src/rygel/rygel-plugin-loader.vala
index 293f566..cdff7cd 100644
--- a/src/rygel/rygel-plugin-loader.vala
+++ b/src/rygel/rygel-plugin-loader.vala
@@ -122,10 +122,7 @@ public class Rygel.PluginLoader : Object {
         }
 
         foreach (var info in infos) {
-            string file_name = info.get_name ();
-            string file_path = Path.build_filename (dir.get_path (), file_name);
-
-            File file = File.new_for_path (file_path);
+            var file = dir.get_child (info.get_name ());
             FileType file_type = info.get_file_type ();
             string content_type = info.get_content_type ();
             string mime = ContentType.get_mime_type (content_type);
@@ -135,7 +132,7 @@ public class Rygel.PluginLoader : Object {
                 this.load_modules_from_dir.begin (file);
             } else if (mime == "application/x-sharedlib") {
                 // Seems like we found a module
-                this.load_module_from_file (file_path);
+                this.load_module_from_file (file.get_path ());
             }
         }
 



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