summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2012-10-17 16:55:32 +0900
committerRobert Ancell <robert.ancell@canonical.com>2012-11-08 14:33:25 +1300
commit464d158cddee3ba5ccae5d3dff9fce1cffe1c316 (patch)
tree1de0f2ada312e562b7b89f96f43b1ad0d16d8834
parentb16d0d8f8bcd556867f3bfe12176af234ca36337 (diff)
downloaddconf-464d158cddee3ba5ccae5d3dff9fce1cffe1c316.tar.gz
editor: Fix search order of schema dirs
https://bugzilla.gnome.org/show_bug.cgi?id=686270
-rw-r--r--editor/dconf-model.vala9
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);
}