From: Raul Gutierrez Segales Date: Thu, 1 Sep 2011 22:16:27 +0000 (+0100) Subject: tracker: conditional compilation of GLib.SpawnError exception handling X-Git-Tag: FOLKS_0_6_2~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4c941605f6ce0d2708da468e89abacf2b01a629;p=platform%2Fupstream%2Ffolks.git 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 --- 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