[dconf] editor: Fix search order of schema dirs



commit 464d158cddee3ba5ccae5d3dff9fce1cffe1c316
Author: Daiki Ueno <ueno unixuser org>
Date:   Wed Oct 17 16:55:32 2012 +0900

    editor: Fix search order of schema dirs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686270

 editor/dconf-model.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index fe95ffe..9c8cc18 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -586,9 +586,14 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
         schemas = new SchemaList();
         try
         {
-            foreach (var dir in GLib.Environment.get_system_data_dirs())
+            var dirs = GLib.Environment.get_system_data_dirs();
+
+            /* Walk directories in reverse so the schemas in the
+             * directory which appears first in the XDG_DATA_DIRS are
+             * not overridden. */
+            for (int i = dirs.length - 1; i >= 0; i--)
             {
-                var path = Path.build_filename (dir, "glib-2.0", "schemas", null);
+                var path = Path.build_filename (dirs[i], "glib-2.0", "schemas");
                 if (File.new_for_path (path).query_exists ())
                     schemas.load_directory (path);
             }



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