From f53a259ef2bbae4af9356b21eb8a7dab56282c56 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 9 May 2011 08:32:30 +0200 Subject: editor: Load schemas from GSETTINGS_SCHEMA_DIR if set Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622292 --- editor/dconf-model.vala | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.1