Hi all:
I’m trying to subscribe to the DBUS signal org.gtk.vfs.Metadata.AttributeChanged to detect changes in the Metadata of files, but I’m unable to receive them. I tried with this piece of code (which works for other signals, like the ones from UDisks), changing the icon of a file while it is running, but doesn’t react to the AttributeChanged signal. I checked with dbus-monitor and it is being emitted, but I can’t receive it. Also tried with Javascript code, but had the same result.
Thanks.
using GLib;
// using GIO
using Gee;
using Gtk;
[DBus(name = "org.gtk.vfs.Metadata")]
interface Metadata_if : GLib.Object {
public signal void AttributeChanged(string tree_path, string file_path);
}
void s(string a, string b) {
print("Metadata signal received\n");
}
class MetadataTest : GLib.Object {
GLib.DBusConnection dbus_connection;
Metadata_if metadata;
public MetadataTest() {
try {
this.metadata = Bus.get_proxy_sync<Metadata_if>(BusType.SESSION, "org.gtk.vfs.Metadata", "/org/gtk/vfs/Metadata");
this.metadata.AttributeChanged.connect(s);
} catch (GLib.IOError e) {
this.metadata = null;
this.dbus_connection = null;
}
}
public void do_print() {
print("Launched\n");
}
}
int main(string[] args) {
var c = new MetadataTest();
c.do_print();
var loop = new GLib.MainLoop();
loop.run();
c.do_print();
return 0;
}