[tracker/direct-access: 22/47] libtracker-data: Do not fetch resource count in read-only mode



commit 4bcf48c4799612655637cb89d604b591c4a144e1
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jul 8 10:08:28 2010 +0200

    libtracker-data: Do not fetch resource count in read-only mode

 src/libtracker-data/tracker-data-manager.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 56b83ed..c1d2baa 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1393,7 +1393,9 @@ db_get_static_data (TrackerDBInterface *iface)
 			tracker_class_set_id (class, id);
 
 			/* xsd classes do not derive from rdfs:Resource and do not use separate tables */
-			if (!g_str_has_prefix (tracker_class_get_name (class), "xsd:")) {
+			/* no need to fetch resource count if we are running in read-only mode (direct access) */
+			if (!g_str_has_prefix (tracker_class_get_name (class), "xsd:") &&
+			    (tracker_db_manager_get_flags () & TRACKER_DB_MANAGER_READONLY) == 0) {
 				/* update statistics */
 				stmt = tracker_db_interface_create_statement (iface, &error, "SELECT COUNT(1) FROM \"%s\"", tracker_class_get_name (class));
 



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