[gnome-documents] changeMonitor: Port to GDBus
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] changeMonitor: Port to GDBus
- Date: Thu, 19 Jul 2012 02:29:51 +0000 (UTC)
commit bec77916869900e106ef4d7082664c00b6be409c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jul 18 21:31:11 2012 -0400
changeMonitor: Port to GDBus
https://bugzilla.gnome.org/show_bug.cgi?id=680219
src/changeMonitor.js | 36 +++++++++++++++++-------------------
1 files changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/src/changeMonitor.js b/src/changeMonitor.js
index f341d19..c07d01c 100644
--- a/src/changeMonitor.js
+++ b/src/changeMonitor.js
@@ -19,28 +19,26 @@
*
*/
-const DBus = imports.dbus;
+const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Signals = imports.signals;
const Global = imports.global;
-const TrackerResourcesServiceIface = {
- name: 'org.freedesktop.Tracker1.Resources',
- signals: [{ name: 'GraphUpdated',
- inSignature: 'sa(iiii)a(iiii)' }]
-};
-
-const TrackerResourcesService = new Lang.Class({
- Name: 'TrackerResourcesService',
-
- _init: function() {
- DBus.session.proxifyObject(this,
- 'org.freedesktop.Tracker1',
- '/org/freedesktop/Tracker1/Resources');
- }
-});
-DBus.proxifyPrototype(TrackerResourcesService.prototype, TrackerResourcesServiceIface);
+const TrackerResourcesServiceIface = <interface name='org.freedesktop.Tracker1.Resources'>
+ <signal name="GraphUpdated">
+ <arg name="className" type="s" />
+ <arg name="deleteEvents" type="a(iiii)" />
+ <arg name="insertEvents" type="a(iiii)" />
+ </signal>
+</interface>;
+
+var TrackerResourcesServiceProxy = Gio.DBusProxy.makeProxyWrapper(TrackerResourcesServiceIface);
+function TrackerResourcesService() {
+ return new TrackerResourcesServiceProxy(Gio.DBus.session,
+ 'org.freedesktop.Tracker1',
+ '/org/freedesktop/Tracker1/Resources');
+}
const ChangeEventType = {
CHANGED: 0,
@@ -84,10 +82,10 @@ const TrackerChangeMonitor = new Lang.Class({
this._pendingChanges = [];
this._resourceService = new TrackerResourcesService();
- this._resourceService.connect('GraphUpdated', Lang.bind(this, this._onGraphUpdated));
+ this._resourceService.connectSignal('GraphUpdated', Lang.bind(this, this._onGraphUpdated));
},
- _onGraphUpdated: function(proxy, className, deleteEvents, insertEvents) {
+ _onGraphUpdated: function(proxy, senderName, [className, deleteEvents, insertEvents]) {
deleteEvents.forEach(Lang.bind(this,
function(event) {
this._outstandingOps++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]