core: Simplify code by using File.get_child
authorJens Georg <mail@jensge.org>
Fri, 17 Feb 2012 08:20:10 +0000 (10:20 +0200)
committerJens Georg <mail@jensge.org>
Mon, 20 Feb 2012 08:51:18 +0000 (10:51 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=660477

src/rygel/rygel-plugin-loader.vala

index 293f566..cdff7cd 100644 (file)
@@ -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 ());
             }
         }