[gnome-documents] all: don't force the Tracker DBus backend
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] all: don't force the Tracker DBus backend
- Date: Fri, 9 Sep 2011 17:12:49 +0000 (UTC)
commit 369001e71d71dce8e171ff4f2cf32a3e115dca9d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Sep 9 13:11:34 2011 -0400
all: don't force the Tracker DBus backend
Now that we have an API to ensure we can close the sparql cursor at the
right time, use it (depending on tracker >= 0.12) and remove the DBus
backend limitation.
configure.ac | 3 ++-
src/application.js | 6 ------
src/changeMonitor.js | 2 ++
src/documents.js | 2 ++
src/offsetController.js | 10 ++++++----
src/trackerController.js | 2 ++
src/trackerUtils.js | 15 ++++++++-------
7 files changed, 22 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 416009d..9683529 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,7 @@ GOBJECT_INTROSPECTION_MIN_VERSION=0.9.6
GDATA_MIN_VERSION=0.9.1
GOA_MIN_VERSION=3.1.90
CLUTTER_GTK_MIN_VERSION=1.0.1
+TRACKER_MIN_VERSION=0.12.0
PKG_CHECK_MODULES(DOCUMENTS,
clutter-gtk-1.0 >= $CLUTTER_GTK_MIN_VERSION
@@ -64,7 +65,7 @@ PKG_CHECK_MODULES(DOCUMENTS,
gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_MIN_VERSION
gtk+-3.0 >= $GTK_MIN_VERSION
gnome-desktop-3.0
- tracker-sparql-0.12
+ tracker-sparql-0.12 >= $TRACKER_MIN_VERSION
goa-1.0 >= $GOA_MIN_VERSION
libgdata >= $GDATA_MIN_VERSION
oauth)
diff --git a/src/application.js b/src/application.js
index e2a7b36..138c416 100644
--- a/src/application.js
+++ b/src/application.js
@@ -103,12 +103,6 @@ Application.prototype = {
Gettext.textdomain('gnome-documents');
String.prototype.format = Format.format;
- // FIXME: tracker cursor have a bug when using the SQLite interface,
- // where the data doesn't get updated until the cursor is finalized.
- // Unfortunately, this doesn't play nice with garbage collection, so
- // we need to force the (slow) DBus backend until that's fixed.
- GLib.setenv('TRACKER_SPARQL_BACKEND', 'bus', true);
-
GLib.set_prgname('gnome-documents');
GtkClutter.init(null, null);
EvDoc.init();
diff --git a/src/changeMonitor.js b/src/changeMonitor.js
index ae9e09d..f218c3b 100644
--- a/src/changeMonitor.js
+++ b/src/changeMonitor.js
@@ -90,6 +90,8 @@ TrackerChangeMonitor.prototype = {
this._pendingChanges.push(subject);
}
+ cursor.close();
+
this._updateCollector();
}));
}));
diff --git a/src/documents.js b/src/documents.js
index 265622a..e9934e2 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -99,6 +99,8 @@ DocCommon.prototype = {
let valid = object.next_finish(res);
if (valid)
this.populateFromCursor(object);
+
+ cursor.close();
}));
} catch (e) {
log('Unable to refresh file information: ' + e.toString());
diff --git a/src/offsetController.js b/src/offsetController.js
index 10068a4..0060c39 100644
--- a/src/offsetController.js
+++ b/src/offsetController.js
@@ -58,11 +58,13 @@ OffsetController.prototype = {
cursor.next_async(null, Lang.bind(this,
function(object, res) {
let valid = object.next_finish(res);
- if (!valid)
- return;
- this._itemCount = cursor.get_integer(0);
- this.emit('item-count-changed', this._itemCount);
+ if (valid) {
+ this._itemCount = cursor.get_integer(0);
+ this.emit('item-count-changed', this._itemCount);
+ }
+
+ cursor.close();
}));
}));
},
diff --git a/src/trackerController.js b/src/trackerController.js
index 26902d4..8bba318 100644
--- a/src/trackerController.js
+++ b/src/trackerController.js
@@ -94,10 +94,12 @@ TrackerController.prototype = {
if (!valid) {
// signal the total count update and return
+ cursor.close();
this._onQueryFinished(null);
return;
}
} catch (e) {
+ cursor.close();
this._onQueryFinished(e);
return;
}
diff --git a/src/trackerUtils.js b/src/trackerUtils.js
index 25219d8..97353f6 100644
--- a/src/trackerUtils.js
+++ b/src/trackerUtils.js
@@ -46,18 +46,19 @@ function resourceUrnFromSourceId(sourceId, callback) {
try {
let valid = cursor.next_finish(res);
- if (!valid) {
- callback(urn);
- return;
- }
+ if (valid)
+ urn = cursor.get_string(0)[0];
+
+ cursor.close();
+ callback(urn);
} catch (e) {
log('Unable to resolve account ID -> resource URN: ' + e.toString());
+
+ cursor.close();
callback(urn);
+
return;
}
-
- urn = cursor.get_string(0)[0];
- callback(urn);
});
});
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]