tracker r1391 - in branches/indexer-split: . src/trackerd
- From: ifrade svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1391 - in branches/indexer-split: . src/trackerd
- Date: Mon, 12 May 2008 11:03:36 +0100 (BST)
Author: ifrade
Date: Mon May 12 10:03:35 2008
New Revision: 1391
URL: http://svn.gnome.org/viewvc/tracker?rev=1391&view=rev
Log:
tracker_db_close uses TrackerDBInterface instead of DBConnection
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/trackerd/tracker-db-sqlite.c
branches/indexer-split/src/trackerd/tracker-db-sqlite.h
branches/indexer-split/src/trackerd/tracker-main.c
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c Mon May 12 10:03:35 2008
@@ -846,13 +846,11 @@
}
void
-tracker_db_close (DBConnection *db_con)
+tracker_db_close (TrackerDBInterface *iface)
{
- if (db_con->db) {
- g_object_unref (db_con->db);
- db_con->db = NULL;
+ if (iface) {
+ g_object_unref (iface);
}
-
tracker_debug ("Database closed");
}
@@ -1042,35 +1040,35 @@
/* close emails */
if (email_blob_db_con) {
- tracker_db_close (email_blob_db_con);
+ tracker_db_close (email_blob_db_con->db);
free_db_con (email_blob_db_con);
}
if (email_db_con) {
- tracker_db_close (email_db_con);
+ tracker_db_close (email_db_con->db);
g_free (email_db_con);
}
/* close files */
if (file_blob_db_con) {
- tracker_db_close (file_blob_db_con);
+ tracker_db_close (file_blob_db_con->db);
free_db_con (file_blob_db_con);
}
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
g_free (db_con);
/* close others */
if (common_db_con) {
- tracker_db_close (common_db_con);
+ tracker_db_close (common_db_con->db);
free_db_con (common_db_con);
}
if (cache_db_con) {
- tracker_db_close (cache_db_con);
+ tracker_db_close (cache_db_con->db);
free_db_con (cache_db_con);
}
@@ -1286,12 +1284,12 @@
}
/* close and reopen all databases */
- tracker_db_close (db_con);
- tracker_db_close (db_con->blob);
+ tracker_db_close (db_con->db);
+ tracker_db_close (db_con->blob->db);
- tracker_db_close (emails->blob);
- tracker_db_close (emails->common);
- tracker_db_close (emails);
+ tracker_db_close (emails->blob->db);
+ tracker_db_close (emails->common->db);
+ tracker_db_close (emails->db);
open_file_db (db_con);
open_file_content_db (db_con->blob);
@@ -1321,9 +1319,9 @@
DBConnection *emails = db_con->emails;
- tracker_db_close (emails->blob);
- tracker_db_close (emails->common);
- tracker_db_close (emails);
+ tracker_db_close (emails->blob->db);
+ tracker_db_close (emails->common->db);
+ tracker_db_close (emails->db);
open_email_content_db (emails->blob);
open_common_db (emails->common);
@@ -1468,8 +1466,8 @@
load_service_description_file (db_con, "default.service");
tracker_db_exec_no_reply (db_con->db, "ANALYZE");
-
- tracker_db_close (db_con);
+
+ tracker_db_close (db_con->db);
g_free (db_con);
}
@@ -1501,8 +1499,9 @@
gboolean
-tracker_db_needs_data ()
+tracker_db_common_need_build ()
{
+ /* TODO: Check here also if it is up to date! */
return !tracker_db_manager_file_exists (TRACKER_DB_COMMON);
}
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.h (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.h Mon May 12 10:03:35 2008
@@ -90,11 +90,11 @@
} FieldData;
gboolean tracker_db_needs_setup (void);
-gboolean tracker_db_needs_data (void);
+gboolean tracker_db_common_need_build (void);
gboolean tracker_db_load_prepared_queries (void);
void tracker_db_thread_init (void);
void tracker_db_thread_end (void);
-void tracker_db_close (DBConnection *db_con);
+void tracker_db_close (TrackerDBInterface *iface);
void tracker_db_finalize (void);
DBConnection * tracker_db_connect (void);
DBConnection * tracker_db_connect_common (void);
Modified: branches/indexer-split/src/trackerd/tracker-main.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.c (original)
+++ branches/indexer-split/src/trackerd/tracker-main.c Mon May 12 10:03:35 2008
@@ -379,20 +379,20 @@
"update ServiceTypes set TypeCount = 0 where Embedded = 1");
}
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
g_free (db_con);
/* Create databases */
db_con = tracker_db_connect_file_content ();
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
g_free (db_con);
db_con = tracker_db_connect_email_content ();
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
g_free (db_con);
db_con = tracker_db_connect_emails ();
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
g_free (db_con);
}
@@ -561,9 +561,9 @@
/* FIXME: is this actually necessary? */
db_con = tracker_db_connect_cache ();
- tracker_db_close (db_con);
+ tracker_db_close (db_con->db);
- need_data = tracker_db_needs_data ();
+ need_data = tracker_db_common_need_build ();
if (need_data) {
tracker_create_common_db ();
@@ -758,7 +758,7 @@
/* Reset integrity status as threads have closed cleanly */
tracker_db_set_option_int (main_thread_db_con, "IntegrityCheck", 0);
- tracker_db_close (main_thread_db_con);
+ tracker_db_close (main_thread_db_con->db);
/* This must be called after all other db functions */
tracker_db_finalize ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]