[folks] tracker: conditional compilation of GLib.SpawnError exception handling
- From: Raul Gutierrez Segales <raulgs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] tracker: conditional compilation of GLib.SpawnError exception handling
- Date: Thu, 1 Sep 2011 23:14:23 +0000 (UTC)
commit e4c941605f6ce0d2708da468e89abacf2b01a629
Author: Raul Gutierrez Segales <rgs collabora co uk>
Date: Thu Sep 1 23:16:27 2011 +0100
tracker: conditional compilation of GLib.SpawnError exception handling
Starting Tracker 0.10.6, the GLib.SpawnError is exception is thrown
when calling Tracker.Sparql.Connection.get (). So we need to test
for the installed version and catch or not the exception, accordingly.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=657650
configure.ac | 11 ++++++++++-
tests/lib/tracker/Makefile.am | 5 +++++
tests/lib/tracker/backend.vala | 2 ++
3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b1b65c7..00ecf86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,6 +131,7 @@ TP_GLIB_REQUIRED=0.13.1
VALA_REQUIRED=0.13.3
VALADOC_REQUIRED=0.3.1
TRACKER_SPARQL_REQUIRED=0.10
+TRACKER_SPARQL_NEWER_VER=0.10.6
GCONF2_REQUIRED=2.31
EBOOK_REQUIRED=3.1.5
EDATASERVER_REQUIRED=3.1.5
@@ -148,8 +149,16 @@ PKG_CHECK_MODULES([GEE], [gee-1.0 < 0.7])
PKG_CHECK_MODULES([TP_GLIB], [telepathy-glib >= $TP_GLIB_REQUIRED])
if test x$enable_tracker_backend = xyes; then
+ # Starting Tracker 0.10.6, the GLib.SpawnError is exception is thrown
+ # when calling Tracker.Sparql.Connection.get (). So we need to test
+ # for the installed version and catch or not the exception, accordingly.
PKG_CHECK_MODULES([TRACKER_SPARQL],
- [tracker-sparql-0.10 >= $TRACKER_SPARQL_REQUIRED])
+ [tracker-sparql-0.10 >= $TRACKER_SPARQL_NEWER_VER],
+ [AM_CONDITIONAL(HAVE_NEW_TRACKER, [ test 1 == 1 ])],
+ [PKG_CHECK_MODULES([TRACKER_SPARQL],
+ [tracker-sparql-0.10 >= $TRACKER_SPARQL_REQUIRED],
+ [AM_CONDITIONAL(HAVE_NEW_TRACKER, [ test 0 == 1 ])])]
+ )
fi
if test x$enable_eds_backend = xyes; then
diff --git a/tests/lib/tracker/Makefile.am b/tests/lib/tracker/Makefile.am
index c8520c8..da78f65 100644
--- a/tests/lib/tracker/Makefile.am
+++ b/tests/lib/tracker/Makefile.am
@@ -1,3 +1,7 @@
+if HAVE_NEW_TRACKER
+TRACKER_VER_CONSTANTS = -D USE_NEW_SPAWN_EXCEPTION
+endif
+
VALAFLAGS += \
$(ERROR_VALAFLAGS) \
--library=tracker-test \
@@ -12,6 +16,7 @@ VALAFLAGS += \
--pkg tracker-sparql-0.10 \
--pkg folks-tracker \
-g \
+ $(TRACKER_VER_CONSTANTS) \
$(NULL)
noinst_LTLIBRARIES = libtracker-test.la
diff --git a/tests/lib/tracker/backend.vala b/tests/lib/tracker/backend.vala
index 942052e..f411ed2 100644
--- a/tests/lib/tracker/backend.vala
+++ b/tests/lib/tracker/backend.vala
@@ -255,11 +255,13 @@ public class TrackerTest.Backend
throw new BackendSetupError.ADD_CONTACT_FAILED
("Error fetching SPARQL connection handler : %s\n", e3.message);
}
+#if USE_NEW_SPAWN_EXCEPTION
catch (GLib.SpawnError e4)
{
throw new BackendSetupError.ADD_CONTACT_FAILED
("Error fetching SPARQL connection handler : %s\n", e4.message);
}
+#endif
}
private void _add_contacts () throws BackendSetupError
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]