Port to GDBus 2

The GDBus bindings in gjs have been updated to leverage metaclasses
and gobject inheritance, which should result in cleaner and more
maintainable code.
This commit is contained in:
Giovanni Campagna
2011-12-10 14:54:39 +01:00
parent aef9b733e5
commit a6b4d68a1d
20 changed files with 543 additions and 286 deletions

View File

@ -21,7 +21,16 @@ const GnomeShellIface = <interface name="org.gnome.Shell.Extensions">
</signal>
</interface>;
const GnomeShellProxy = Gio.DBusProxy.makeProxyWrapper(GnomeShellIface);
const GnomeShellProxy = new Gio.DBusProxyClass({
Name: 'GnomeShellProxy',
Interface: GnomeShellIface,
_init: function() {
this.parent({ g_bus_type: Gio.BusType.SESSION,
g_name: 'org.gnome.Shell',
g_object_path: '/org/gnome/Shell' });
}
});
function stripPrefix(string, prefix) {
if (string.slice(0, prefix.length) == prefix)
@ -191,7 +200,8 @@ const Application = new Lang.Class({
this._extensionPrefsBin.add(label);
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
this._shellProxy = new GnomeShellProxy();
this._shellProxy.init(null);
this._shellProxy.connectSignal('ExtensionStatusChanged', Lang.bind(this, function(proxy, senderName, [uuid, state, error]) {
if (ExtensionUtils.extensions[uuid] !== undefined)
this._scanExtensions();