[tracker/disable-fts: 9/10] libtracker-db: Support disabling FTS
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/disable-fts: 9/10] libtracker-db: Support disabling FTS
- Date: Tue, 15 Jun 2010 12:42:51 +0000 (UTC)
commit 775e19ad118de060cee4eee54f451dc9e871d32f
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue Jun 15 12:48:22 2010 +0200
libtracker-db: Support disabling FTS
src/libtracker-db/tracker-db-interface-sqlite.c | 12 +++++++++++-
src/libtracker-db/tracker-db-manager.c | 11 +++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index 6cf8953..dcc52bf 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -26,7 +26,10 @@
#include <math.h>
#include <libtracker-common/tracker-common.h>
+
+#if HAVE_TRACKER_FTS
#include <libtracker-fts/tracker-fts.h>
+#endif
#include "tracker-db-interface-sqlite.h"
@@ -41,7 +44,9 @@ struct TrackerDBInterface {
GSList *function_data;
guint ro : 1;
+#if HAVE_TRACKER_FTS
guint fts_initialized : 1;
+#endif
volatile gint interrupt;
};
@@ -575,9 +580,11 @@ close_database (TrackerDBInterface *db_interface)
g_slist_free (db_interface->function_data);
db_interface->function_data = NULL;
+#if HAVE_TRACKER_FTS
if (db_interface->fts_initialized) {
tracker_fts_shutdown (G_OBJECT (db_interface));
}
+#endif
rc = sqlite3_close (db_interface->db);
g_warn_if_fail (rc == SQLITE_OK);
@@ -587,8 +594,12 @@ void
tracker_db_interface_sqlite_fts_init (TrackerDBInterface *db_interface,
gboolean create)
{
+#if HAVE_TRACKER_FTS
tracker_fts_init (db_interface->db, create, G_OBJECT (db_interface));
db_interface->fts_initialized = TRUE;
+#else
+ g_message ("FTS support is disabled");
+#endif
}
static void
@@ -602,7 +613,6 @@ tracker_db_interface_sqlite_finalize (GObject *object)
g_message ("Closed sqlite3 database:'%s'", db_interface->filename);
-
g_free (db_interface->filename);
G_OBJECT_CLASS (tracker_db_interface_parent_class)->finalize (object);
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index 2d42da1..b2a9825 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -36,7 +36,10 @@
#include <libtracker-common/tracker-date-time.h>
#include <libtracker-common/tracker-file-utils.h>
#include <libtracker-common/tracker-utils.h>
+
+#if HAVE_TRACKER_FTS
#include <libtracker-fts/tracker-fts.h>
+#endif
#include "tracker-db-journal.h"
#include "tracker-db-manager.h"
@@ -993,10 +996,14 @@ tracker_db_manager_shutdown (void)
sys_tmp_dir = NULL;
g_free (sql_dir);
+#if HAVE_TRACKER_FTS
/* shutdown fts in all threads
- needs to be done before shutting down all db interfaces as
- shutdown does not happen in thread where interface was created */
+ * needs to be done before shutting down all db interfaces as
+ * shutdown does not happen in thread where interface was created
+ */
tracker_fts_shutdown_all ();
+#endif
+
/* shutdown db interfaces in all threads */
g_static_private_free (&interface_data_key);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]