[folks] Convert BackendStore to use GFiles more uniformly



commit 0f5aa36122dc1575611ccab7eaa639e6216b5640
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Sep 16 15:20:54 2010 +0100

    Convert BackendStore to use GFiles more uniformly

 folks/backend-store.vala |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index 8983e06..f1e28e3 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -245,10 +245,7 @@ public class Folks.BackendStore : 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);
+          File file = dir.get_child (info.get_name ());
           FileType file_type = info.get_file_type ();
           unowned string content_type = info.get_content_type ();
           /* don't load the library multiple times for its various symlink
@@ -263,12 +260,12 @@ public class Folks.BackendStore : Object {
             }
           else if (mime == "application/x-sharedlib" && !is_symlink)
             {
-              this.load_module_from_file (file_path);
+              this.load_module_from_file (file);
             }
           else if (mime == null)
             {
               warning ("MIME type could not be determined for file '%s'. " +
-                  "Have you installed shared-mime-info?", file_path);
+                  "Have you installed shared-mime-info?", file.get_path ());
             }
         }
 
@@ -276,8 +273,10 @@ public class Folks.BackendStore : Object {
           dir.get_path ());
     }
 
-  private void load_module_from_file (string file_path)
+  private void load_module_from_file (File file)
     {
+      string file_path = file.get_path ();
+
       Module module = Module.open (file_path, ModuleFlags.BIND_LOCAL);
       if (module == null)
         {



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