[tracker/libtracker-sparql: 23/43] libtracker-sparql: Use dedicated module directory



commit 0bb6ed487bcb198103acff25d7dd553ad5578202
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jul 20 18:11:58 2010 +0200

    libtracker-sparql: Use dedicated module directory

 src/libtracker-sparql/Makefile.am                |    5 ++++
 src/libtracker-sparql/config.vapi                |   23 ++++++++++++++++++++++
 src/libtracker-sparql/tracker-plugin-loader.vala |    7 ++---
 3 files changed, 31 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-sparql/Makefile.am b/src/libtracker-sparql/Makefile.am
index 0005a86..a4b1251 100644
--- a/src/libtracker-sparql/Makefile.am
+++ b/src/libtracker-sparql/Makefile.am
@@ -1,8 +1,11 @@
 include $(top_srcdir)/Makefile.decl
 
+modulesdir = $(libdir)/tracker-$(TRACKER_API_VERSION)/sparql-modules
+
 INCLUDES =								\
 	-DG_LOG_DOMAIN=\"Tracker\"					\
 	-DTRACKER_COMPILATION						\
+	-DSPARQL_MODULES_DIR=\""$(modulesdir)"\" 			\
 	-I$(top_srcdir)/src						\
 	-I$(top_builddir)/src						\
 	$(WARN_CFLAGS)							\
@@ -40,6 +43,7 @@ vapi_DATA =                     			\
 
 # Vala sources
 vapi_sources =						\
+	config.vapi					\
 	$(top_srcdir)/src/vapi/posix.vapi		\
 	$(top_srcdir)/src/vapi/glib-2.0-fixes.vapi
 
@@ -63,5 +67,6 @@ MAINTAINERCLEANFILES =					\
 	tracker-sparql.h
 
 EXTRA_DIST = 						\
+	config.vapi \
 	$(libtracker_sparql_la_VALASOURCES) \
 	libtracker-sparql.vala.stamp
diff --git a/src/libtracker-sparql/config.vapi b/src/libtracker-sparql/config.vapi
new file mode 100644
index 0000000..2e593e7
--- /dev/null
+++ b/src/libtracker-sparql/config.vapi
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2010, Nokia <ivan frade nokia com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+[CCode (cprefix = "", lower_case_cprefix = "")]
+namespace Config {
+	public const string SPARQL_MODULES_DIR;
+}
diff --git a/src/libtracker-sparql/tracker-plugin-loader.vala b/src/libtracker-sparql/tracker-plugin-loader.vala
index d5db518..ff7228b 100644
--- a/src/libtracker-sparql/tracker-plugin-loader.vala
+++ b/src/libtracker-sparql/tracker-plugin-loader.vala
@@ -91,8 +91,7 @@ class Tracker.Sparql.PluginLoader : Connection {
 		if (env_path != null && env_path.length > 0) {
 			path = env_path;
 		} else {
-			// FIXME: Get from config
-			path = "/tmp";
+			path = Config.SPARQL_MODULES_DIR;
 		}
 
 		File dir = File.new_for_path (path);
@@ -101,12 +100,12 @@ class Tracker.Sparql.PluginLoader : Connection {
 		debug ("Searching for modules in folder '%s' ..", dir_path);
 
 		// First get direct library details
-		string direct_path = Module.build_path (dir_path, "tracker-direct-0.9");
+		string direct_path = Module.build_path (dir_path, "tracker-direct");
 		direct = load_plugins_from_path (direct_path, direct_only /* required */);
 
 		if (!direct_only) {
 			// Second get bus library details
-			string bus_path = Module.build_path (dir_path, "tracker-bus-0.9");
+			string bus_path = Module.build_path (dir_path, "tracker-bus");
 			bus = load_plugins_from_path (bus_path, true /* required */);
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]