[dconf-editor] Emit value_changed for DConfKey on external change
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Emit value_changed for DConfKey on external change
- Date: Sun, 17 Dec 2017 01:46:30 +0000 (UTC)
commit 4b92dfbb6d4668a32469f73786f62b99c8912db8
Author: Davi da Silva Böger <dsboger gmail com>
Date: Tue Dec 12 22:41:25 2017 -0200
Emit value_changed for DConfKey on external change
editor/dconf-model.vala | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 29098f3..a213563 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -246,7 +246,7 @@ public class DConfKey : Key
{
public override string descriptor { owned get { return full_name; } }
- public DConfKey (string parent_full_name, string name, string type_string)
+ public DConfKey (DConf.Client client, string parent_full_name, string name, string type_string)
{
Object (full_name: parent_full_name + name, name: name, type_string: type_string);
@@ -268,6 +268,15 @@ public class DConfKey : Key
}
builder.close ();
properties = builder.end ();
+
+ client.changed.connect ((client, prefix, changes, tag) => {
+ foreach (string item in changes)
+ if (prefix + item == full_name)
+ {
+ value_changed ();
+ return;
+ }
+ });
}
}
@@ -826,7 +835,7 @@ public class SettingsModel : Object
private void create_dconf_key (string parent_path, string key_id, GLib.ListStore key_model)
{
Variant value = (!) client.read (parent_path + key_id);
- DConfKey new_key = new DConfKey (parent_path, key_id, value.get_type_string ());
+ DConfKey new_key = new DConfKey (client, parent_path, key_id, value.get_type_string ());
key_model.append (new_key);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]