[dconf-editor] Prepare GSettingsKey for relocatable schemas
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Prepare GSettingsKey for relocatable schemas
- Date: Thu, 30 Nov 2017 23:13:35 +0000 (UTC)
commit 766e4d6e0f530b0b21dec982c2af2e7eae2ea935
Author: Davi da Silva Böger <dsboger gmail com>
Date: Sun Nov 26 05:54:49 2017 -0200
Prepare GSettingsKey for relocatable schemas
Test if the schema is relocatable when the Directory is creating the
GSettings of the key. Also use the same GSettings object in
other places where the schema cannot be tested.
editor/dconf-model.vala | 10 +++++++---
editor/key-list-box-row.vala | 2 +-
editor/modifications-revealer.vala | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 85934ff..2f15cab 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -111,7 +111,11 @@ public class Directory : SettingObject
return;
gsettings_key_map = ((!) settings_schema).list_keys ();
- settings = new GLib.Settings (((!) settings_schema).get_id ());
+ string? path = ((!) settings_schema).get_path ();
+ if (path == null) // relocatable
+ settings = new GLib.Settings.with_path (((!) settings_schema).get_id (), full_name);
+ else
+ settings = new GLib.Settings (((!) settings_schema).get_id ());
foreach (string key_id in (!) gsettings_key_map)
create_gsettings_key (key_id, ((!) settings_schema).get_key (key_id));
@@ -472,7 +476,7 @@ public class GSettingsKey : Key
public override string descriptor { owned get { return @"$schema_id $name"; } }
- private GLib.Settings settings;
+ public GLib.Settings settings { get; construct; }
public override Variant value
{
@@ -500,6 +504,7 @@ public class GSettingsKey : Key
Object (full_name: parent.full_name + name,
name: name,
+ settings : settings,
// schema infos
schema_id: schema_id,
summary: summary,
@@ -508,7 +513,6 @@ public class GSettingsKey : Key
range_type: range_type,
range_content: range_content);
- this.settings = settings;
settings.changed [name].connect (() => value_changed ());
this.type_string = type_string;
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index eef8e80..03c54c3 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -616,7 +616,7 @@ private class ContextPopover : Popover
set_group ("flags");
string group_dot = "flags.";
- GLib.Settings settings = new GLib.Settings (key.schema_id);
+ GLib.Settings settings = key.settings;
string [] active_flags = settings.get_strv (key.name);
string [] all_flags = key.range_content.get_strv ();
SimpleAction [] flags_actions = new SimpleAction [0];
diff --git a/editor/modifications-revealer.vala b/editor/modifications-revealer.vala
index a464d1e..da1cd6a 100644
--- a/editor/modifications-revealer.vala
+++ b/editor/modifications-revealer.vala
@@ -158,7 +158,7 @@ class ModificationsRevealer : Revealer
GLib.Settings? settings = delayed_settings_hashtable.lookup (key.schema_id);
if (settings == null)
{
- settings = new GLib.Settings (key.schema_id);
+ settings = key.settings;
((!) settings).delay ();
delayed_settings_hashtable.insert (key.schema_id, (!) settings);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]