[dconf] editor: Load schemas from GSETTINGS_SCHEMA_DIR if set
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] editor: Load schemas from GSETTINGS_SCHEMA_DIR if set
- Date: Mon, 9 May 2011 06:34:15 +0000 (UTC)
commit f53a259ef2bbae4af9356b21eb8a7dab56282c56
Author: Rui Matos <tiagomatos gmail com>
Date: Mon May 9 08:32:30 2011 +0200
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 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]