tracker r1773 - in branches/indexer-split: . src/libtracker-db
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1773 - in branches/indexer-split: . src/libtracker-db
- Date: Thu, 26 Jun 2008 11:57:14 +0000 (UTC)
Author: pvanhoof
Date: Thu Jun 26 11:57:14 2008
New Revision: 1773
URL: http://svn.gnome.org/viewvc/tracker?rev=1773&view=rev
Log:
2008-06-26 Philip Van Hoof <pvanhoof gnome org>
* src/libtracker-db/tracker-db-manager.c: Giving out correct ifaces
with correct attachments for service-specific database conenctions
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-db/tracker-db-manager.c
Modified: branches/indexer-split/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-manager.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-manager.c Thu Jun 26 11:57:14 2008
@@ -133,8 +133,6 @@
FALSE },
};
-static gboolean db_manager_had_init = FALSE;
-
static gboolean db_exec_no_reply (TrackerDBInterface *iface,
const gchar *query,
...);
@@ -2555,8 +2553,10 @@
tracker_db_manager_get_db_interface_by_service (const gchar *service,
gboolean content)
{
- TrackerDBType type;
- TrackerDB db;
+ TrackerDBInterface *iface;
+ TrackerDBType type;
+ static TrackerDBInterface *file_iface = NULL;
+ static TrackerDBInterface *email_iface = NULL;
g_return_val_if_fail (initialized != FALSE, NULL);
g_return_val_if_fail (service != NULL, NULL);
@@ -2565,23 +2565,29 @@
switch (type) {
case TRACKER_DB_TYPE_EMAIL:
- if (G_UNLIKELY (content)) {
- db = TRACKER_DB_EMAIL_CONTENTS;
- } else {
- db = TRACKER_DB_EMAIL_METADATA;
+ if (!email_iface) {
+ email_iface = tracker_db_manager_get_db_interfaces (4,
+ TRACKER_DB_COMMON,
+ TRACKER_DB_EMAIL_CONTENTS,
+ TRACKER_DB_EMAIL_METADATA,
+ TRACKER_DB_CACHE);
}
+ iface = email_iface;
break;
default:
- if (G_UNLIKELY (content)) {
- db = TRACKER_DB_FILE_CONTENTS;
- } else {
- db = TRACKER_DB_FILE_METADATA;
+ if (!file_iface) {
+ file_iface = tracker_db_manager_get_db_interfaces (4,
+ TRACKER_DB_COMMON,
+ TRACKER_DB_FILE_CONTENTS,
+ TRACKER_DB_FILE_METADATA,
+ TRACKER_DB_CACHE);
}
+ iface = file_iface;
break;
}
- return tracker_db_manager_get_db_interface (db);
+ return iface;
}
TrackerDBInterface *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]