summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2011-05-09 08:32:30 +0200
committerRobert Ancell <robert.ancell@canonical.com>2011-05-09 08:34:10 +0200
commitf53a259ef2bbae4af9356b21eb8a7dab56282c56 (patch)
tree9e3b731fafd05dc458342055c1bb4177df0faa79
parent73a263d710d3b629c1af4fb1e112671e494ee79d (diff)
downloaddconf-f53a259ef2bbae4af9356b21eb8a7dab56282c56.tar.gz
editor: Load schemas from GSETTINGS_SCHEMA_DIR if set
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622292
-rw-r--r--editor/dconf-model.vala11
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index f2ca1be..46e8f6c 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -564,7 +564,16 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
schemas = new SchemaList();
try
{
- schemas.load_directory("/usr/share/glib-2.0/schemas");
+ foreach (var dir in GLib.Environment.get_system_data_dirs())
+ {
+ var path = Path.build_filename (dir, "glib-2.0", "schemas", null);
+ if (File.new_for_path (path).query_exists ())
+ schemas.load_directory (path);
+ }
+
+ var dir = GLib.Environment.get_variable ("GSETTINGS_SCHEMA_DIR");
+ if (dir != null)
+ schemas.load_directory(dir);
} catch (Error e) {
warning("Failed to parse schemas: %s", e.message);
}