tracker r1483 - in branches/xesam-support: . data/services src/trackerd



Author: pvanhoof
Date: Mon May 26 10:02:32 2008
New Revision: 1483
URL: http://svn.gnome.org/viewvc/tracker?rev=1483&view=rev

Log:
2008-05-26  Ottela Mikael <mikael ottela ixonos com>

	* src/trackerd/tracker-xesam-live-search.c
	* src/trackerd/tracker-xesam-ontology.c
	* src/trackerd/tracker-xesam-ontology.h
	* src/trackerd/tracker-xesam-session.c
	* src/trackerd/tracker-dbus-xesam.c
	* src/trackerd/tracker-xesam.c
	* src/trackerd/tracker-db-sqlite.c
	* src/trackerd/tracker-db-sqlite.h
	* src/trackerd/tracker-db-manager.c
	* src/trackerd/Makefile.am
	* src/trackerd/tracker-db-manager.h
	* data/services/xesam-metadata.mmapping:

	Various improvements to the database handling
	Added Xesam ontology mapping helper functions



Modified:
   branches/xesam-support/ChangeLog
   branches/xesam-support/data/services/xesam-metadata.mmapping
   branches/xesam-support/src/trackerd/Makefile.am
   branches/xesam-support/src/trackerd/tracker-db-manager.c
   branches/xesam-support/src/trackerd/tracker-db-manager.h
   branches/xesam-support/src/trackerd/tracker-db-sqlite.c
   branches/xesam-support/src/trackerd/tracker-db-sqlite.h
   branches/xesam-support/src/trackerd/tracker-dbus-xesam.c
   branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
   branches/xesam-support/src/trackerd/tracker-xesam-session.c
   branches/xesam-support/src/trackerd/tracker-xesam.c

Modified: branches/xesam-support/data/services/xesam-metadata.mmapping
==============================================================================
--- branches/xesam-support/data/services/xesam-metadata.mmapping	(original)
+++ branches/xesam-support/data/services/xesam-metadata.mmapping	Mon May 26 10:02:32 2008
@@ -27,7 +27,7 @@
 MetaName=
 
 [xesam:artist]
-MetaName=
+MetaName=Audio:Artist
 
 
 [xesam:asText]

Modified: branches/xesam-support/src/trackerd/Makefile.am
==============================================================================
--- branches/xesam-support/src/trackerd/Makefile.am	(original)
+++ branches/xesam-support/src/trackerd/Makefile.am	Mon May 26 10:02:32 2008
@@ -136,6 +136,8 @@
 	tracker-status.h						\
 	tracker-xesam.h							\
 	tracker-xesam.c							\
+	tracker-xesam-ontology.c					\
+	tracker-xesam-ontology.h					\
 	tracker-xesam-query.c						\
 	tracker-xesam-query.h						\
 	tracker-xesam-session.c						\

Modified: branches/xesam-support/src/trackerd/tracker-db-manager.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-manager.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-manager.c	Mon May 26 10:02:32 2008
@@ -24,6 +24,8 @@
 #define TRACKER_DB_MANAGER_FILE_META_FILENAME          "file-meta.db"
 #define TRACKER_DB_MANAGER_EMAIL_CONTENTS_FILENAME     "email-contents.db"
 #define TRACKER_DB_MANAGER_EMAIL_META_FILENAME         "email-meta.db"
+#define TRACKER_DB_MANAGER_XESAM_FILENAME              "xesam.db"
+
 
 #define TRACKER_DB_MANAGER_COMMON_NAME             "common"
 #define TRACKER_DB_MANAGER_CACHE_NAME              "cache"
@@ -31,6 +33,7 @@
 #define TRACKER_DB_MANAGER_FILE_META_NAME          NULL
 #define TRACKER_DB_MANAGER_EMAIL_CONTENTS_NAME     NULL
 #define TRACKER_DB_MANAGER_EMAIL_META_NAME         NULL
+#define TRACKER_DB_MANAGER_XESAM_NAME              NULL
 
 
 static gboolean initialized = FALSE;
@@ -108,6 +111,15 @@
          512,
          TRACKER_DB_PAGE_SIZE_DEFAULT,
          FALSE},
+
+        {TRACKER_DB_XESAM,
+         TRACKER_DB_MANAGER_XESAM_FILENAME,
+         TRACKER_DB_LOC_DATA_DIR,
+         NULL,
+         NULL,
+         512,
+         TRACKER_DB_PAGE_SIZE_DEFAULT,
+         TRUE},
 };
 
 TrackerDBDefinition *tracker_dbs [TRACKER_DB_END];

Modified: branches/xesam-support/src/trackerd/tracker-db-manager.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-manager.h	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-manager.h	Mon May 26 10:02:32 2008
@@ -33,6 +33,7 @@
         TRACKER_DB_FILE_CONTENTS,
         TRACKER_DB_EMAIL_META,
         TRACKER_DB_EMAIL_CONTENTS,
+	TRACKER_DB_XESAM,
         TRACKER_DB_END
 } TrackerDatabase;
 

Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.c	Mon May 26 10:02:32 2008
@@ -49,6 +49,7 @@
 #include "tracker-query-tree.h"
 #include "tracker-xesam.h"
 #include "tracker-main.h"
+#include "tracker-xesam-ontology.h"
 
 #define MAX_INDEX_TEXT_LENGTH 1048576
 #define MAX_TEXT_BUFFER       65567
@@ -971,46 +972,62 @@
 DBConnection *
 tracker_db_connect_xesam ()
 {
-
 	DBConnection *db_con;
-	DBConnection *blob_db_con = NULL;
-	Indexer *word_index_db_con = NULL;
+	TrackerDBInterface *iface;
+	gboolean create_table = FALSE;
 
-	DBConnection *common_db_con = NULL;
+	create_table = !tracker_db_manager_file_exists (TRACKER_DB_XESAM);
 
-	DBConnection *emails_blob_db_con = NULL;
-	DBConnection *emails_db_con= NULL;
-	Indexer *email_word_index_db_con= NULL;
+	iface = open_db_interface (TRACKER_DB_XESAM);
 
-	db_con = tracker_db_connect_file_meta ();
-	emails_db_con = tracker_db_connect_email_meta ();
+	if (create_table) {
+		g_message ("Creating xesam database... %s",
+			     tracker_db_manager_get_file (TRACKER_DB_XESAM));
 
-	blob_db_con = tracker_db_connect_file_content ();
-	emails_blob_db_con = tracker_db_connect_email_content ();
-	common_db_con  = tracker_db_connect_common ();
 
-	word_index_db_con = tracker->file_index;
-	email_word_index_db_con = tracker->email_index;
+		load_sql_file (iface, "sqlite-xesam.sql");
+		
+		tracker_db_load_xesam_service_file (iface, "xesam.metadata");
+		tracker_db_load_xesam_service_file (iface, "xesam-convenience.metadata");
+		tracker_db_load_xesam_service_file (iface, "xesam-virtual.metadata");
+		tracker_db_load_xesam_service_file (iface, "xesam.service");
+		tracker_db_load_xesam_service_file (iface, "xesam-convenience.service");
+		tracker_db_load_xesam_service_file (iface, "xesam-service.smapping");
+		tracker_db_load_xesam_service_file (iface, "xesam-metadata.mmapping");
+		
+		tracker_db_create_xesam_lookup(iface);
+	}
 
-	db_con->cache = tracker_db_connect_cache ();
+	tracker_db_exec_no_reply (iface, 
+				  "ATTACH '%s' as %s",
+				  tracker_db_manager_get_file (TRACKER_DB_FILE_META),
+				  tracker_db_manager_get_name (TRACKER_DB_FILE_META));
 
-	db_con->blob = blob_db_con;
-	db_con->data = db_con;
-	db_con->emails = emails_db_con;
-	db_con->common = common_db_con;
-	db_con->word_index = word_index_db_con;
+	tracker_db_exec_no_reply (iface, 
+				  "ATTACH '%s' as %s",
+				  tracker_db_manager_get_file (TRACKER_DB_EMAIL_META),
+				  tracker_db_manager_get_name (TRACKER_DB_EMAIL_META));
 
-	emails_db_con->common = common_db_con;
-	emails_db_con->blob = emails_blob_db_con;
-	emails_db_con->data = db_con;
-	emails_db_con->word_index = email_word_index_db_con;
-	emails_db_con->cache = db_con->cache;
+	tracker_db_exec_no_reply (iface, 
+				  "ATTACH '%s' as %s",
+				  tracker_db_manager_get_file (TRACKER_DB_COMMON),
+				  tracker_db_manager_get_name (TRACKER_DB_COMMON));
+
+	tracker_db_exec_no_reply (iface, 
+				  "ATTACH '%s' as %s",
+				  tracker_db_manager_get_file (TRACKER_DB_CACHE),
+				  tracker_db_manager_get_name (TRACKER_DB_CACHE));
+
+	// Create the static data (hashtables etc)
 
-	tracker_db_attach_db (db_con, TRACKER_DB_COMMON);
-	tracker_db_attach_db (db_con, TRACKER_DB_CACHE);
-	
-	return db_con;
 
+
+	// FIXME This function should eventually return DB interface, not connection.
+
+	db_con = g_new0 (DBConnection, 1);
+	db_con->db = iface;
+
+	return db_con;
 }
 
 void
@@ -1137,18 +1154,6 @@
 		load_service_description_file (db_con->db, "image.metadata");	
 		load_service_description_file (db_con->db, "video.metadata");	
 
-		load_sql_file (db_con->db, "sqlite-xesam.sql");
-
-		tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
-		tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
-		tracker_db_load_xesam_service_file (db_con, "xesam-virtual.metadata");
-		tracker_db_load_xesam_service_file (db_con, "xesam.service");
-		tracker_db_load_xesam_service_file (db_con, "xesam-convenience.service");
-		tracker_db_load_xesam_service_file (db_con, "xesam-service.smapping");
-		tracker_db_load_xesam_service_file (db_con, "xesam-metadata.mmapping");
-
-		tracker_db_create_xesam_lookup(db_con);
-
 		tracker_db_exec_no_reply (db_con->db, "ANALYZE");
 	}
 
@@ -1510,18 +1515,6 @@
 
 	load_service_description_file (db_con->db, "default.service");
 
-	load_sql_file (db_con->db, "sqlite-xesam.sql");
-
-	tracker_db_load_xesam_service_file (db_con, "xesam.metadata");
-	tracker_db_load_xesam_service_file (db_con, "xesam-convenience.metadata");
-	tracker_db_load_xesam_service_file (db_con, "xesam-virtual.metadata");
-	tracker_db_load_xesam_service_file (db_con, "xesam.service");
-	tracker_db_load_xesam_service_file (db_con, "xesam-convenience.service");
-	tracker_db_load_xesam_service_file (db_con, "xesam-service.smapping");
-	tracker_db_load_xesam_service_file (db_con, "xesam-metadata.mmapping");
-
-	tracker_db_create_xesam_lookup(db_con);	
-
 	tracker_db_exec_no_reply (db_con->db, "ANALYZE");
 	
 	tracker_db_close (db_con->db);
@@ -3312,7 +3305,7 @@
 	 * FROM LiveSearches 
 	 * WHERE SearchID = ? */
 
-	return tracker_exec_proc (db_con->cache, "GetLiveSearchHitCount", search_id, NULL);
+	return tracker_db_exec_proc (db_con->db, "GetLiveSearchHitCount", search_id, NULL);
 }
 
 
@@ -3325,7 +3318,7 @@
 	 * AND X.SearchID = ? 
 	 * AND E.EventType IS 'Delete' */
 
-	return tracker_exec_proc (db_con->cache, "GetLiveSearchDeletedIDs", search_id, NULL);
+	return tracker_db_exec_proc (db_con->db, "GetLiveSearchDeletedIDs", search_id, NULL);
 }
 
 void
@@ -3335,7 +3328,7 @@
 	 * FROM LiveSearches as X 
 	 * WHERE E.SearchID = ? */
 
-	tracker_exec_proc_no_reply (db_con->cache->db, "LiveSearchStopSearch", search_id, NULL);
+	tracker_exec_proc_no_reply (db_con->db, "LiveSearchStopSearch", search_id, NULL);
 }
 
 
@@ -3346,7 +3339,7 @@
 	 * INTO LiveSearches
 	 * SELECT ID, SEARCH_ID FROM_QUERY WHERE_QUERY */
 
-	tracker_db_exec_no_reply (db_con->db,  NULL,
+	tracker_db_exec_no_reply (db_con->db,
 		"INSERT INTO LiveSearches SELECT ID, '%s' %s %s",
 			search_id, from_query, where_query);
 }
@@ -3370,6 +3363,8 @@
 	 *      OR X.EventType IS 'Update')
 	 **/
 
+	g_debug("tracker_db_get_live_search_new_ids");
+
 	return tracker_db_exec (db_con->db,
 	/* COLUMNS */      "SELECT E.ServiceID, E.EventType%s%s "
 	/* FROM_QUERY */   "%s%s LiveSearches as X, Events as E "
@@ -3400,15 +3395,15 @@
 TrackerDBResultSet* 
 tracker_db_get_events (DBConnection *db_con)
 {
-	tracker_exec_proc_no_reply (db_con->cache->db, "SetEventsBeingHandled", NULL);
-	return tracker_exec_proc (db_con->cache, "GetEvents", NULL);
+	tracker_exec_proc_no_reply (db_con->db, "SetEventsBeingHandled", NULL);
+	return tracker_db_exec_proc (db_con->db, "GetEvents", NULL);
 }
 
 
 void 
 tracker_db_delete_handled_events (DBConnection *db_con)
 {
-	tracker_exec_proc_no_reply (db_con->cache->db, "DeleteHandledEvents", NULL);
+	tracker_exec_proc_no_reply (db_con->db, "DeleteHandledEvents", NULL);
 }
 
 static guint32
@@ -3419,7 +3414,9 @@
 	int	   i;
 	guint32	   id = 0;
 
-	result_set = tracker_exec_proc (db_con->common, "GetNewEventID", NULL);
+	// FIXME We now assume we get the standard db_con, not xesam one.
+
+	result_set = tracker_db_exec_proc (db_con->common->db, "GetNewEventID", NULL);
 
 	if (!result_set) {
 		g_critical ("Could not create event, GetNewEventID failed");
@@ -3432,13 +3429,13 @@
 	i++;
 	eid = tracker_int_to_string (i);
 
-	result_set = tracker_exec_proc (db_con->common, "UpdateNewEventID", eid, NULL);
+	result_set = tracker_db_exec_proc (db_con->common->db, "UpdateNewEventID", eid, NULL);
 	if (result_set)
 		g_object_unref (result_set);
 
 	/* Uses the Events table */
-	result_set = tracker_exec_proc (db_con->cache, "CreateEvent", eid, service_id_str, type, NULL);
-	id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->db));
+	result_set = tracker_db_exec_proc (db_con->common->db, "CreateEvent", eid, service_id_str, type, NULL);
+	id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->common->db));
 	if (result_set)
 		g_object_unref (result_set);
 
@@ -4727,12 +4724,12 @@
 // FIXME Do this in a non-retarded way
 
 gboolean
-get_service_mapping (DBConnection *db_con, const char *type, GList **list)
+get_service_mapping(TrackerDBInterface *iface, const char *type, GList **list)
 {
 	TrackerDBResultSet *result_set;
 	gboolean valid = TRUE;
 
-	result_set = tracker_exec_proc (db_con, "GetXesamServiceMappings", type, NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamServiceMappings", type, NULL);
 
 	if (result_set) {
 		while (valid) {
@@ -4750,7 +4747,7 @@
 		g_object_unref (result_set);
 	}
 
-	result_set = tracker_exec_proc (db_con, "GetXesamServiceChildren", type, NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamServiceChildren", type, NULL);
 	valid = TRUE;
 
 	if (result_set) {
@@ -4758,7 +4755,7 @@
 			gchar *st;
 			
 			tracker_db_result_set_get (result_set, 0, &st, -1);
-			get_service_mapping(db_con, st ,list);
+			get_service_mapping(iface, st ,list);
 			
 			valid = tracker_db_result_set_iter_next (result_set);
 			g_free (st);
@@ -4771,12 +4768,12 @@
 }
 
 gboolean
-get_metadata_mapping(DBConnection *db_con, const char *type, GList **list)
+get_metadata_mapping(TrackerDBInterface *iface, const char *type, GList **list)
 {
 	TrackerDBResultSet *result_set;
 	gboolean valid = TRUE;
 
-	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataMappings", type, NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamMetaDataMappings", type, NULL);
 
 	if (result_set) {
 		while (valid) {
@@ -4794,7 +4791,7 @@
 		g_object_unref (result_set);
 	}
 
-	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataChildren", type, NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamMetaDataChildren", type, NULL);
 	valid = TRUE;
 
 	if (result_set) {
@@ -4802,7 +4799,7 @@
 			gchar *st;
 			
 			tracker_db_result_set_get (result_set, 0, &st, -1);
-			get_service_mapping(db_con, st ,list);
+			get_service_mapping(iface, st ,list);
 			
 			valid = tracker_db_result_set_iter_next (result_set);
 			g_free (st);
@@ -4816,12 +4813,12 @@
 
 
 gboolean
-tracker_db_create_xesam_lookup (DBConnection *db_con)
+tracker_db_create_xesam_lookup (TrackerDBInterface *iface)
 {
 	TrackerDBResultSet   *result_set;
 	gboolean              valid = TRUE;
 
-	result_set = tracker_exec_proc (db_con, "GetXesamServiceTypes", NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamServiceTypes", NULL);
 	
 	if (result_set) {
 		while (valid) {
@@ -4830,11 +4827,11 @@
 				GList *iter = NULL;
 				
 				tracker_db_result_set_get (result_set, 0, &st, -1);
-				get_service_mapping(db_con, st, &list);
-				
+				get_service_mapping(iface, st, &list);
+
 				iter = g_list_first(list);
 				while (iter) {
-					tracker_exec_proc (db_con, "InsertXesamServiceLookup", st, iter->data, NULL);
+					tracker_db_exec_proc (iface, "InsertXesamServiceLookup", st, iter->data, NULL);
 					g_free(iter->data);
 					
 					iter = g_list_next (iter);
@@ -4850,7 +4847,7 @@
 	g_object_unref (result_set);	
 	valid = TRUE;
 
-	result_set = tracker_exec_proc (db_con, "GetXesamMetaDataTypes", NULL);
+	result_set = tracker_db_exec_proc (iface, "GetXesamMetaDataTypes", NULL);
 
 	if (result_set) {
 		while (valid) {
@@ -4859,11 +4856,11 @@
 				GList *iter = NULL;	
 
 				tracker_db_result_set_get (result_set, 0, &st, -1);
-				get_metadata_mapping(db_con, st, &list);
-				
+				get_metadata_mapping(iface, st, &list);
+
 				iter = g_list_first(list);
 				while (iter) {
-					tracker_exec_proc (db_con, "InsertXesamMetaDataLookup", st, iter->data, NULL);
+					tracker_db_exec_proc (iface, "InsertXesamMetaDataLookup", st, iter->data, NULL);
 					g_free(iter->data);
 					
 					iter = g_list_next (iter);
@@ -4882,7 +4879,7 @@
 }
 
 gboolean
-tracker_db_load_xesam_service_file (DBConnection *db_con, const char *filename)
+tracker_db_load_xesam_service_file (TrackerDBInterface *iface, const char *filename)
 {
 	GKeyFile 		*key_file = NULL;
 	const char * const 	*locale_array;
@@ -4921,14 +4918,14 @@
 		for (array = groups; *array; array++) {
                         if (is_metadata) {
 
-		                tracker_exec_proc (db_con, "InsertXesamMetadataType", *array, NULL);
-				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->db));
+		                tracker_db_exec_proc (iface, "InsertXesamMetadataType", *array, NULL);
+				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (iface));
 
 
 		        } else if (is_service) {
 				
-		                tracker_exec_proc (db_con, "InsertXesamServiceType", *array, NULL);
-				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (db_con->db));
+		                tracker_db_exec_proc (iface, "InsertXesamServiceType", *array, NULL);
+				id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (iface));
 
 			} else {
 				/* Nothing required */
@@ -4969,7 +4966,7 @@
 							if (parents) {
 								for (parents_p = parents; *parents_p; parents_p++) {
 									sql = g_strdup_printf ("INSERT INTO XesamMetadataChildren (Parent, Child) VALUES ('%s', '%s')", *parents_p, *array);
-									tracker_db_exec_no_reply (db_con->db, sql);
+									tracker_db_exec_no_reply (iface, sql);
 									
 									g_free(sql);
 								}
@@ -4981,7 +4978,7 @@
 							
 							if (data_id != -1) {
 								sql = g_strdup_printf ("update XesamMetadataTypes set DataTypeID = %d where ID = %s", data_id, str_id);
-								tracker_db_exec_no_reply (db_con->db, sql);
+								tracker_db_exec_no_reply (iface, sql);
 								g_free (sql);
 								
 							}
@@ -4992,7 +4989,7 @@
 							
 							sql = g_strdup_printf ("update XesamMetadataTypes set  %s = '%s' where ID = %s", *array2, esc_value, str_id);
 								
-							tracker_db_exec_no_reply (db_con->db, sql);
+							tracker_db_exec_no_reply (iface, sql);
 							g_free (sql);
 							g_free (esc_value);
 						}
@@ -5007,7 +5004,7 @@
 							if (parents) {
 								for (parents_p = parents; *parents_p; parents_p++) {
 									sql = g_strdup_printf ("INSERT INTO XesamServiceChildren (Parent, Child) VALUES ('%s', '%s')", *parents_p, *array);
-									tracker_db_exec_no_reply (db_con->db, sql);
+									tracker_db_exec_no_reply (iface, sql);
 									
 									g_free(sql);
 								}
@@ -5015,7 +5012,7 @@
 						} else {
 							char *esc_value = tracker_escape_string (value);
 							sql = g_strdup_printf ("update XesamServiceTypes set  %s = '%s' where typeID = %s", *array2, esc_value, str_id);
-							tracker_db_exec_no_reply (db_con->db, sql);
+							tracker_db_exec_no_reply (iface, sql);
 							g_free (sql);
 							g_free (esc_value);
 						}
@@ -5028,7 +5025,7 @@
 						if (mappings) {
 							for (mappings_p = mappings; *mappings_p; mappings_p++) {
 								char *esc_value = tracker_escape_string (*mappings_p);
-								tracker_exec_proc (db_con, "InsertXesamMetaDataMapping", *array, esc_value, NULL);
+								tracker_db_exec_proc (iface, "InsertXesamMetaDataMapping", *array, esc_value, NULL);
 								g_free (esc_value);
 							}
 						}
@@ -5041,7 +5038,7 @@
 						if (mappings) {
 							for (mappings_p = mappings; *mappings_p; mappings_p++) {
 								char *esc_value = tracker_escape_string (*mappings_p);
-								tracker_exec_proc (db_con, "InsertXesamServiceMapping", *array, esc_value, NULL);
+								tracker_db_exec_proc (iface, "InsertXesamServiceMapping", *array, esc_value, NULL);
 								g_free (esc_value);
 							}
 						}

Modified: branches/xesam-support/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db-sqlite.h	(original)
+++ branches/xesam-support/src/trackerd/tracker-db-sqlite.h	Mon May 26 10:02:32 2008
@@ -337,9 +337,9 @@
 TrackerDBResultSet *tracker_get_xesam_service_names           (DBConnection *db_con, 
                                                                const char *name);
 
-gboolean            tracker_db_load_xesam_service_file 	       (DBConnection *db_con, 
+gboolean            tracker_db_load_xesam_service_file 	       (TrackerDBInterface *iface, 
                                                                 const char *filename);
-gboolean            tracker_db_create_xesam_lookup             (DBConnection *db_con);
+gboolean            tracker_db_create_xesam_lookup             (TrackerDBInterface *iface);
 void                tracker_db_stop_live_search                (DBConnection *db_con, 
                                                                 const gchar *search_id);
 void                tracker_db_start_live_search               (DBConnection *db_con, 

Modified: branches/xesam-support/src/trackerd/tracker-dbus-xesam.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-dbus-xesam.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-dbus-xesam.c	Mon May 26 10:02:32 2008
@@ -475,6 +475,8 @@
 	if (session)
 		g_object_unref (session);
 
+	g_debug("tracker_dbus_xesam_new_search done");
+
 	tracker_dbus_request_success (request_id);
 }
 

Modified: branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-live-search.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-live-search.c	Mon May 26 10:02:32 2008
@@ -489,6 +489,8 @@
 
 		g_object_get (proxy, "db-connection", &db_con, NULL);
 
+		g_debug ("live_search_get_hits");
+
 		// For ottela: fetch results for get_hits
 
 		result_set = tracker_db_get_live_search_get_hit_data (db_con,

Modified: branches/xesam-support/src/trackerd/tracker-xesam-session.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam-session.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam-session.c	Mon May 26 10:02:32 2008
@@ -381,6 +381,8 @@
 	TrackerXesamLiveSearch  *search;
 	TrackerXesamSessionPriv *priv = self->priv;
 
+	g_debug ("Creating search for xesam session: \n %s", query_xml);
+
 	search = tracker_xesam_live_search_new (query_xml);
 
 	tracker_xesam_live_search_set_session (search, self);
@@ -388,6 +390,7 @@
 
 	if (tracker_xesam_live_search_parse_query (search, error)) {
 
+		g_debug ("Xesam live search added");
 		g_hash_table_insert (priv->searches, 
 			g_strdup (tracker_xesam_live_search_get_id (search)),
 			g_object_ref (search));
@@ -396,6 +399,7 @@
 			*search_id = g_strdup (tracker_xesam_live_search_get_id (search));
 
 	} else {
+		g_message ("Xesam search parse failed");
 		g_object_unref (search);
 		search = NULL;
 	}

Modified: branches/xesam-support/src/trackerd/tracker-xesam.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-xesam.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-xesam.c	Mon May 26 10:02:32 2008
@@ -210,6 +210,8 @@
 
 	while (sessions) {
 		GList *searches;
+		g_debug ("Session being handled, ID :%s", tracker_xesam_session_get_id (sessions->data));
+
 		searches = tracker_xesam_session_get_searches (sessions->data);
 
 		while (searches) {
@@ -217,6 +219,8 @@
 			GArray                 *added = NULL;
 			GArray                 *removed = NULL;
 			GArray                 *modified = NULL;
+			g_debug ("Search being handled, ID :%s", tracker_xesam_live_search_get_id (searches->data));
+
 			search = searches->data;
 			tracker_xesam_live_search_match_with_events (search, 
 								     &added, 



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