summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/dconf.vala21
-rw-r--r--client/dconf.vapi2
-rw-r--r--editor/dconf-model.vala10
3 files changed, 12 insertions, 21 deletions
diff --git a/bin/dconf.vala b/bin/dconf.vala
index 88db9e6..646b275 100644
--- a/bin/dconf.vala
+++ b/bin/dconf.vala
@@ -205,29 +205,24 @@ void show_path (DConf.Client client, string path) {
}
}
-void watch_function (DConf.Client client, string path, string[] items, string tag) {
- if (items.length == 0) {
- print ("%s\n", path);
- show_path (client, path);
- print ("\n");
- } else {
- foreach (var item in items) {
- var full = path + item;
- print ("%s\n", full);
- show_path (client, full);
- }
- print ("\n");
+void watch_function (DConf.Client client, string path, string[] items, string? tag) {
+ foreach (var item in items) {
+ var full = path + item;
+ print ("%s\n", full);
+ show_path (client, full);
}
+ print ("\n");
}
void dconf_watch (string?[] args) throws Error {
var client = new DConf.Client ();
- client.changed.connect (watch_function);
var path = args[2];
DConf.verify_path (path);
+ client.changed.connect (watch_function);
client.watch_sync (path);
+
new MainLoop (null, false).run ();
}
diff --git a/client/dconf.vapi b/client/dconf.vapi
index af293aa..7e5cdae 100644
--- a/client/dconf.vapi
+++ b/client/dconf.vapi
@@ -3,7 +3,7 @@
namespace DConf {
[CCode (cheader_filename = "dconf.h")]
public class Client : GLib.Object {
- public signal void changed (string prefix, string[] changes, string tag);
+ public signal void changed (string prefix, [CCode (array_length = false, array_null_terminated = true)] string[] changes, string? tag);
public Client ();
public GLib.Variant? read (string key);
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index fc772a6..ff45a29 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -570,13 +570,9 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
public signal void item_changed (string key);
- void watch_func (DConf.Client client, string path, string[] items, string tag) {
- if (items.length == 0) {
- item_changed (path);
- } else {
- foreach (var item in items) {
- item_changed (path + item);
- }
+ void watch_func (DConf.Client client, string path, string[] items, string? tag) {
+ foreach (var item in items) {
+ item_changed (path + item);
}
}