diff options
author | Rui Matos <tiagomatos@gmail.com> | 2011-05-09 08:32:30 +0200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-05-09 08:34:10 +0200 |
commit | f53a259ef2bbae4af9356b21eb8a7dab56282c56 (patch) | |
tree | 9e3b731fafd05dc458342055c1bb4177df0faa79 | |
parent | 73a263d710d3b629c1af4fb1e112671e494ee79d (diff) | |
download | dconf-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.vala | 11 |
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); } |