diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-07-10 14:16:48 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-07-10 14:19:43 -0400 |
commit | b1cf066711a06526e66bd0b271ec49c9416add9d (patch) | |
tree | 38c58426c6898029e5743964264cdf082e13aba6 /bin | |
parent | 77d9ae4b75e6811470ddbb577f25acb03f3b1506 (diff) | |
download | dconf-b1cf066711a06526e66bd0b271ec49c9416add9d.tar.gz |
Fix up the "changed" signal for Vala
Fix the vapi file to properly describe the changed signal (including the
possibility of NULL tag).
Change the dconf tool's implementation of the signal handler (and
simplify it due to the changed semantics of the signal).
Do the same for the editor.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dconf.vala | 21 |
1 files changed, 8 insertions, 13 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 (); } |