[Xfce4-commits] <midori:master> Check user data dir first for resource files

Christian Dywan noreply at xfce.org
Sun May 16 17:58:01 CEST 2010


Updating branch refs/heads/master
         to 486ebfb930e42f93dc7417f6fd31b4ac8b1993d6 (commit)
       from 0fca240bf6feadbe6be9016b8c82f3f73c306a74 (commit)

commit 486ebfb930e42f93dc7417f6fd31b4ac8b1993d6
Author: Peter de Ridder <peter at xfce.org>
Date:   Sun May 16 17:47:21 2010 +0200

    Check user data dir first for resource files

 midori/sokoke.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/midori/sokoke.c b/midori/sokoke.c
index b23383f..04c37af 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -1483,7 +1483,7 @@ sokoke_find_config_filename (const gchar* folder,
  * Looks for the specified filename in the system data
  * directories, depending on the platform.
  *
- * Return value: a full path
+ * Return value: a newly allocated full path
  **/
 gchar*
 sokoke_find_data_filename (const gchar* filename)
@@ -1491,10 +1491,16 @@ sokoke_find_data_filename (const gchar* filename)
     const gchar* const* data_dirs = g_get_system_data_dirs ();
     guint i = 0;
     const gchar* data_dir;
+    gchar* path;
+
+    path = g_build_filename (g_get_user_data_dir (), filename, NULL);
+    if (g_access (path, F_OK) == 0)
+        return path;
+    g_free (path);
 
     while ((data_dir = data_dirs[i++]))
     {
-        gchar* path = g_build_filename (data_dir, filename, NULL);
+        path = g_build_filename (data_dir, filename, NULL);
         if (g_access (path, F_OK) == 0)
             return path;
         g_free (path);



More information about the Xfce4-commits mailing list