tracker r2228 - in branches/indexer-split: . src/libtracker-common src/libtracker-db src/tracker-indexer src/tracker-indexer/modules src/trackerd tests/libtracker-common



Author: mr
Date: Mon Sep 15 11:03:01 2008
New Revision: 2228
URL: http://svn.gnome.org/viewvc/tracker?rev=2228&view=rev

Log:
	* src/libtracker-common/tracker-ontology.c:
	* src/libtracker-common/tracker-ontology.h:
	* src/libtracker-db/tracker-db-index-manager.c:
	* src/libtracker-db/tracker-db-manager.c:
	* src/tracker-indexer/modules/files.c:
	* src/tracker-indexer/tracker-indexer.c:
	* src/tracker-indexer/tracker-metadata-utils.c:
	* src/trackerd/tracker-db.c:
	* src/trackerd/tracker-files.c:
	* src/trackerd/tracker-metadata.c:
	* src/trackerd/tracker-query-tree.c:
	* src/trackerd/tracker-rdf-query.c:
	* src/trackerd/tracker-search.c:
	* tests/libtracker-common/tracker-ontology-test.c: More ontology
	API improvements.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-ontology.c
   branches/indexer-split/src/libtracker-common/tracker-ontology.h
   branches/indexer-split/src/libtracker-db/tracker-db-index-manager.c
   branches/indexer-split/src/libtracker-db/tracker-db-manager.c
   branches/indexer-split/src/tracker-indexer/modules/files.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer.c
   branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
   branches/indexer-split/src/trackerd/tracker-db.c
   branches/indexer-split/src/trackerd/tracker-files.c
   branches/indexer-split/src/trackerd/tracker-metadata.c
   branches/indexer-split/src/trackerd/tracker-query-tree.c
   branches/indexer-split/src/trackerd/tracker-rdf-query.c
   branches/indexer-split/src/trackerd/tracker-search.c
   branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c

Modified: branches/indexer-split/src/libtracker-common/tracker-ontology.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-ontology.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-ontology.c	Mon Sep 15 11:03:01 2008
@@ -222,13 +222,13 @@
 }
 
 TrackerService *
-tracker_ontology_service_get_by_name (const gchar *service_str)
+tracker_ontology_get_service_by_name (const gchar *service_str)
 {
 	return ontology_hash_lookup_by_str (service_table, service_str);
 }
 
 gchar *
-tracker_ontology_service_get_by_id (gint id)
+tracker_ontology_get_service_by_id (gint id)
 {
 	TrackerService *service;
 
@@ -242,7 +242,7 @@
 }
 
 gchar *
-tracker_ontology_service_get_by_mime (const gchar *mime) 
+tracker_ontology_get_service_by_mime (const gchar *mime) 
 {
 	gpointer             id;
 	ServiceMimePrefixes *item;
@@ -251,7 +251,7 @@
 	/* Try a complete mime */
 	id = g_hash_table_lookup (mime_service, mime);
 	if (id) {
-		return tracker_ontology_service_get_by_id (GPOINTER_TO_INT (id));
+		return tracker_ontology_get_service_by_id (GPOINTER_TO_INT (id));
 	}
 
 	/* Try in prefixes */
@@ -260,7 +260,7 @@
 	     prefix_service = prefix_service->next) {
 		item = prefix_service->data;
 		if (g_str_has_prefix (mime, item->prefix)) {
-			return tracker_ontology_service_get_by_id (item->service);
+			return tracker_ontology_get_service_by_id (item->service);
 		}
 	}
 	
@@ -269,7 +269,7 @@
 }
 
 gint
-tracker_ontology_service_get_id_by_name (const char *service_str)
+tracker_ontology_get_service_id_by_name (const char *service_str)
 {
 	TrackerService *service;
 
@@ -283,7 +283,7 @@
 }
 
 gchar *
-tracker_ontology_service_get_parent (const gchar *service_str)
+tracker_ontology_get_service_parent (const gchar *service_str)
 {
 	TrackerService *service;
 	const gchar    *parent = NULL;
@@ -298,7 +298,7 @@
 }
 
 gchar *
-tracker_ontology_service_get_parent_by_id (gint id)
+tracker_ontology_get_service_parent_by_id (gint id)
 {
 	TrackerService *service;
 
@@ -312,7 +312,7 @@
 }
 
 gint
-tracker_ontology_service_get_parent_id_by_id (gint id)
+tracker_ontology_get_service_parent_id_by_id (gint id)
 {
 	TrackerService *service;
 	const gchar    *parent = NULL;
@@ -337,7 +337,7 @@
 }
 
 TrackerDBType
-tracker_ontology_service_get_db_by_name (const gchar *service_str)
+tracker_ontology_get_service_db_by_name (const gchar *service_str)
 {
 	TrackerDBType  type;
 	gchar         *str;
@@ -362,10 +362,91 @@
 	return type;
 }
 
+GSList *
+tracker_ontology_get_service_names_registered (void)
+{
+	TrackerService *service;
+	GList          *services, *l;
+	GSList         *names = NULL;
+
+	services = g_hash_table_get_values (service_table);
+
+	for (l = services; l; l = l->next) {
+		service = l->data;
+		names = g_slist_prepend (names, g_strdup (tracker_service_get_name (service)));
+	}
+
+	return names;
+}
+
+GSList *
+tracker_ontology_get_field_names_registered (const gchar *service_str)
+{
+	GList          *field_types, *l;
+	GSList         *names;
+	const gchar    *prefix;
+	const gchar    *parent_prefix = NULL;
+
+	if (service_str) {
+		TrackerService *service;
+		TrackerService *parent;
+		const gchar    *parent_name;
+	
+		service = tracker_ontology_get_service_by_name (service_str);
+		if (!service) {
+			return NULL;
+		}
+
+		/* Prefix for properties of the category */
+		prefix = tracker_service_get_property_prefix (service);
+		
+		if (!prefix || g_strcmp0 (prefix, " ") == 0) {
+			prefix = service_str;
+		}
+		
+		/* Prefix for properties of the parent */
+		parent_name = tracker_ontology_get_service_parent (service_str);
+
+		if (parent_name && (g_strcmp0 (parent_name, " ") != 0)) {
+			parent = tracker_ontology_get_service_by_name (parent_name);
+		
+			if (parent) {
+				parent_prefix = tracker_service_get_property_prefix (parent);
+		
+				if (!parent_prefix || g_strcmp0 (parent_prefix, " ") == 0) {
+					parent_prefix = parent_name;
+				}
+			}
+		}
+	}
+
+	names = NULL;
+	field_types = g_hash_table_get_values (metadata_table);
+
+	for (l = field_types; l; l = l->next) {
+		TrackerField *field;
+		const gchar  *name;
+		
+		field = l->data;
+		name = tracker_field_get_name (field);
+
+		if (service_str == NULL || 
+		    (prefix && g_str_has_prefix (name, prefix)) ||
+		    (parent_prefix && g_str_has_prefix (name, parent_prefix))) {
+			names = g_slist_prepend (names, g_strdup (name));
+		}
+	}
+
+	return names;
+}
+
+/*
+ * Service data
+ */
 gboolean
 tracker_ontology_service_is_valid (const gchar *service_str)
 {
-	return tracker_ontology_service_get_id_by_name (service_str) != -1;
+	return tracker_ontology_get_service_id_by_name (service_str) != -1;
 }
 
 gboolean
@@ -454,7 +535,7 @@
 }
 
 gboolean
-tracker_ontology_show_service_directories (const gchar *service_str) 
+tracker_ontology_service_get_show_directories (const gchar *service_str) 
 {
 	TrackerService *service;
 
@@ -468,7 +549,7 @@
 }
 
 gboolean
-tracker_ontology_show_service_files (const gchar *service_str) 
+tracker_ontology_service_get_show_files (const gchar *service_str) 
 {
 	TrackerService *service;
 
@@ -481,81 +562,6 @@
 	return tracker_service_get_show_service_files (service);
 }
 
-
-GSList *
-tracker_ontology_registered_service_types (void)
-{
-	GList *service_types = NULL, *iter = NULL;
-	GSList *names = NULL;
-	TrackerService *service;
-
-	service_types = g_hash_table_get_values (service_table);
-
-	for (iter = service_types; iter != NULL; iter = iter->next) {
-		service = (TrackerService*)iter->data;
-		names = g_slist_prepend (names, g_strdup (tracker_service_get_name (service)));
-	}
-	return names;
-}
-
-GSList *
-tracker_ontology_registered_field_types (const gchar *service_type)
-{
-	GList *field_types = NULL, *iter = NULL;
-	GSList *names = NULL;
-	TrackerField   *field;
-	TrackerService *service = NULL, *parent;
-	const gchar    *prefix;
-	const gchar    *parent_name = NULL;
-	const gchar    *parent_prefix = NULL;
-
-	if (service_type) {
-		service = tracker_ontology_service_get_by_name (service_type);
-		if (!service) {
-			return NULL;
-		}
-
-		/* Prefix for properties of the category */
-		prefix = tracker_service_get_property_prefix (service);
-		
-		if (!prefix || g_strcmp0 (prefix, " ") == 0) {
-			prefix = service_type;
-		}
-		
-		/* Prefix for properties of the parent */
-		parent_name = tracker_ontology_service_get_parent (service_type);
-
-		if (parent_name && (g_strcmp0 (parent_name, " ") != 0)) {
-			parent = tracker_ontology_service_get_by_name (parent_name);
-		
-			if (parent) {
-			
-				parent_prefix = tracker_service_get_property_prefix (parent);
-		
-				if (!parent_prefix || g_strcmp0 (parent_prefix, " ") == 0) {
-					parent_prefix = parent_name;
-				}
-			}
-		}
-	}
-
-	field_types = g_hash_table_get_values (metadata_table);
-
-	for (iter = field_types; iter != NULL; iter = iter->next) {
-
-		field = (TrackerField*)iter->data;
-
-		const gchar *name = tracker_field_get_name (field);
-
-		if (service_type == NULL 
-		    || (prefix && g_str_has_prefix (name, prefix))
-		    || (parent_prefix && g_str_has_prefix (name, parent_prefix))) {
-			names = g_slist_prepend (names, g_strdup (name));
-		}
-	}
-	return names;
-}
-
 /*
  * Service directories
  */

Modified: branches/indexer-split/src/libtracker-common/tracker-ontology.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-ontology.h	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-ontology.h	Mon Sep 15 11:03:01 2008
@@ -36,16 +36,18 @@
 void            tracker_ontology_service_add                  (TrackerService *service,
 							       GSList         *mimes,
 							       GSList         *mime_prefixes);
-TrackerService *tracker_ontology_service_get_by_name          (const gchar    *service_str);
-gchar *         tracker_ontology_service_get_by_id            (gint            id);
-gchar *         tracker_ontology_service_get_by_mime          (const gchar    *mime);
-
-gint            tracker_ontology_service_get_id_by_name       (const gchar    *service_str);
-TrackerDBType   tracker_ontology_service_get_db_by_name       (const gchar    *service_str);
-
-gchar *         tracker_ontology_service_get_parent           (const gchar    *service_str);
-gchar *         tracker_ontology_service_get_parent_by_id     (gint            id);
-gint            tracker_ontology_service_get_parent_id_by_id  (gint            id);
+TrackerService *tracker_ontology_get_service_by_name          (const gchar    *service_str);
+gchar *         tracker_ontology_get_service_by_id            (gint            id);
+gchar *         tracker_ontology_get_service_by_mime          (const gchar    *mime);
+gint            tracker_ontology_get_service_id_by_name       (const gchar    *service_str);
+TrackerDBType   tracker_ontology_get_service_db_by_name       (const gchar    *service_str);
+
+gchar *         tracker_ontology_get_service_parent           (const gchar    *service_str);
+gchar *         tracker_ontology_get_service_parent_by_id     (gint            id);
+gint            tracker_ontology_get_service_parent_id_by_id  (gint            id);
+
+GSList *        tracker_ontology_get_service_names_registered (void);
+GSList *        tracker_ontology_get_field_names_registered   (const gchar    *service_str);
 
 /* Service data */
 gboolean        tracker_ontology_service_is_valid             (const gchar    *service_str);
@@ -55,10 +57,8 @@
 gboolean        tracker_ontology_service_has_text             (const gchar    *service_str);
 gint            tracker_ontology_service_get_key_metadata     (const gchar    *service_str,
 							       const gchar    *meta_name);
-gboolean        tracker_ontology_show_service_directories     (const gchar    *service_str);
-gboolean        tracker_ontology_show_service_files           (const gchar    *service_str);
-GSList *        tracker_ontology_registered_service_types     (void);
-GSList *        tracker_ontology_registered_field_types       (const gchar    *service_type);
+gboolean        tracker_ontology_service_get_show_directories (const gchar    *service_str);
+gboolean        tracker_ontology_service_get_show_files       (const gchar    *service_str);
 
 /* Service directories */
 GSList *        tracker_ontology_get_dirs_for_service_type    (const gchar    *service_str);

Modified: branches/indexer-split/src/libtracker-db/tracker-db-index-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-index-manager.c	(original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-index-manager.c	Mon Sep 15 11:03:01 2008
@@ -281,7 +281,7 @@
 	g_return_val_if_fail (initialized == TRUE, NULL);
 	g_return_val_if_fail (service != NULL, NULL);
 
-	type = tracker_ontology_service_get_db_by_name (service);
+	type = tracker_ontology_get_service_db_by_name (service);
 
 	switch (type) {
 	case TRACKER_DB_TYPE_FILES:
@@ -308,12 +308,12 @@
 
 	g_return_val_if_fail (initialized == TRUE, NULL);
 
-	service = tracker_ontology_service_get_by_id (id);
+	service = tracker_ontology_get_service_by_id (id);
 	if (!service) {
 		return NULL;
 	}
 
-	type = tracker_ontology_service_get_db_by_name (service);
+	type = tracker_ontology_get_service_db_by_name (service);
 	g_free (service);
 
 	switch (type) {

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	Mon Sep 15 11:03:01 2008
@@ -346,7 +346,7 @@
 
 	for (i = 0; groups[i]; i++) {
 		g_message ("Trying to obtain service:'%s' in cache", groups[i]);
-		service = tracker_ontology_service_get_by_name (groups[i]);
+		service = tracker_ontology_get_service_by_name (groups[i]);
 
 		if (!service) {
 			tracker_db_interface_execute_procedure (iface,
@@ -1218,7 +1218,7 @@
 	GValue  result = { 0, };
 	gchar  *str;
 
-	str = tracker_ontology_service_get_by_id (g_value_get_int (&values[0]));
+	str = tracker_ontology_get_service_by_id (g_value_get_int (&values[0]));
 	g_value_init (&result, G_TYPE_STRING);
 	g_value_take_string (&result, str);
 
@@ -1233,7 +1233,7 @@
 	GValue result = { 0, };
 	gint   id;
 
-	id = tracker_ontology_service_get_id_by_name (g_value_get_string (&values[0]));
+	id = tracker_ontology_get_service_id_by_name (g_value_get_string (&values[0]));
 	g_value_init (&result, G_TYPE_INT);
 	g_value_set_int (&result, id);
 
@@ -1248,7 +1248,7 @@
 	GValue result = { 0, };
 	gint   id;
 
-	id = tracker_ontology_service_get_id_by_name (g_value_get_string (&values[0]));
+	id = tracker_ontology_get_service_id_by_name (g_value_get_string (&values[0]));
 	g_value_init (&result, G_TYPE_INT);
 	g_value_set_int (&result, id);
 
@@ -2583,7 +2583,7 @@
 	g_return_val_if_fail (initialized != FALSE, NULL);
 	g_return_val_if_fail (service != NULL, NULL);
 
-	type = tracker_ontology_service_get_db_by_name (service);
+	type = tracker_ontology_get_service_db_by_name (service);
 
 	switch (type) {
 	case TRACKER_DB_TYPE_EMAIL:
@@ -2641,7 +2641,7 @@
 	g_return_val_if_fail (initialized != FALSE, NULL);
 	g_return_val_if_fail (service != NULL, NULL);
 
-	type = tracker_ontology_service_get_db_by_name (service);
+	type = tracker_ontology_get_service_db_by_name (service);
 
 	switch (type) {
 	case TRACKER_DB_TYPE_EMAIL:

Modified: branches/indexer-split/src/tracker-indexer/modules/files.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/modules/files.c	(original)
+++ branches/indexer-split/src/tracker-indexer/modules/files.c	Mon Sep 15 11:03:01 2008
@@ -56,7 +56,7 @@
         gchar *service_type;
 
         mime_type = tracker_file_get_mime_type (file->path);
-        service_type = tracker_ontology_service_get_by_mime (mime_type);
+        service_type = tracker_ontology_get_service_by_mime (mime_type);
         g_free (mime_type);
 
         return service_type;

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer.c	Mon Sep 15 11:03:01 2008
@@ -1265,7 +1265,7 @@
 		return;
 	}
 
-	service_def = tracker_ontology_service_get_by_name (service_type);
+	service_def = tracker_ontology_get_service_by_name (service_type);
 	g_free (service_type);
 
 	if (!service_def) {
@@ -1352,7 +1352,7 @@
 		return;
 	}
 
-	service_def = tracker_ontology_service_get_by_name (service_type);
+	service_def = tracker_ontology_get_service_by_name (service_type);
 	g_free (service_type);
 
 	if (!service_def) {
@@ -1415,11 +1415,11 @@
 			return;
 		}
 
-		name = tracker_ontology_service_get_by_id (service_type_id);
-		service_def = tracker_ontology_service_get_by_name (name);
+		name = tracker_ontology_get_service_by_id (service_type_id);
+		service_def = tracker_ontology_get_service_by_name (name);
 		g_free (name);
 	} else {
-		service_def = tracker_ontology_service_get_by_name (service_type);
+		service_def = tracker_ontology_get_service_by_name (service_type);
 		service_type_id = tracker_service_get_id (service_def);
 	}
 
@@ -1487,7 +1487,7 @@
 
 	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-	service_def = tracker_ontology_service_get_by_name (service_type);
+	service_def = tracker_ontology_get_service_by_name (service_type);
 	if (!service_def) {
 		g_set_error (error, 
 			     g_quark_from_string (TRACKER_INDEXER_ERROR), 
@@ -1623,7 +1623,7 @@
 	guint service_id, i;
 	gchar *joined = NULL, *dirname = NULL, *basename = NULL;
 
-	service_def = tracker_ontology_service_get_by_name (service_type);
+	service_def = tracker_ontology_get_service_by_name (service_type);
 	if (!service_def) {
 		g_set_error (error, 
 			     g_quark_from_string (TRACKER_INDEXER_ERROR), 
@@ -1736,7 +1736,7 @@
 		return FALSE;
 	}
 
-	service = tracker_ontology_service_get_by_name (service_type);
+	service = tracker_ontology_get_service_by_name (service_type);
 	g_free (service_type);
 
 	if (!service) {

Modified: branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-metadata-utils.c	Mon Sep 15 11:03:01 2008
@@ -296,7 +296,7 @@
 	gchar **values, *service_type;
 	gint i;
 
-	service_type = tracker_ontology_service_get_by_mime (mimetype);
+	service_type = tracker_ontology_get_service_by_mime (mimetype);
 
 	if (!service_type) {
 		return;
@@ -742,7 +742,7 @@
 	gchar *text = NULL;
 
 	mimetype = tracker_file_get_mime_type (path);
-	service_type = tracker_ontology_service_get_by_mime (mimetype);
+	service_type = tracker_ontology_get_service_by_mime (mimetype);
 
 	/* No need to filter text based files - index them directly */
 	if (service_type &&

Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db.c	Mon Sep 15 11:03:01 2008
@@ -281,7 +281,7 @@
 	}
 
 	/* We only do differential updates so only changed words scores are updated */
-	sid = tracker_ontology_service_get_id_by_name (service);
+	sid = tracker_ontology_get_service_id_by_name (service);
 #if 0
 	tracker_db_update_differential_index (old_table, new_table, id, sid);
 #endif
@@ -515,24 +515,24 @@
 	count = 0;
 
 	if (add_files) {
-		services[count++] = tracker_ontology_service_get_id_by_name ("Folders");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Documents");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Images");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Videos");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Music");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Text");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Development");
-		services[count++] = tracker_ontology_service_get_id_by_name ("Other");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Folders");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Documents");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Images");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Videos");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Music");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Text");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Development");
+		services[count++] = tracker_ontology_get_service_id_by_name ("Other");
 	}
 
 	if (add_emails) {
-		services[count++] = tracker_ontology_service_get_id_by_name ("EvolutionEmails");
-		services[count++] = tracker_ontology_service_get_id_by_name ("KMailEmails");
-		services[count++] = tracker_ontology_service_get_id_by_name ("ThunderbirdEmails");
+		services[count++] = tracker_ontology_get_service_id_by_name ("EvolutionEmails");
+		services[count++] = tracker_ontology_get_service_id_by_name ("KMailEmails");
+		services[count++] = tracker_ontology_get_service_id_by_name ("ThunderbirdEmails");
 	}
 	
 	if (add_conversations) {
-		services[count++] = tracker_ontology_service_get_id_by_name ("GaimConversations");
+		services[count++] = tracker_ontology_get_service_id_by_name ("GaimConversations");
 	}
 
 	services[count] = 0;
@@ -2568,7 +2568,7 @@
 	str_mtime = tracker_gint32_to_string (info->mtime);
 	str_offset = tracker_gint32_to_string (info->offset);
 
-	service_type_id = tracker_ontology_service_get_id_by_name (service);
+	service_type_id = tracker_ontology_get_service_id_by_name (service);
 
 	if (info->mime) {
 		g_debug ("service id for %s is %d and sid is %s with mime %s", 
@@ -2620,7 +2620,7 @@
 			g_object_unref (result_set_proc);
 		}
 
-                parent = tracker_ontology_service_get_parent (service);
+                parent = tracker_ontology_get_service_parent (service);
 		
 		if (parent) {
 			result_set_proc = tracker_db_exec_proc (iface, 
@@ -2675,7 +2675,7 @@
 		tracker_db_result_set_get (result_set, 3, &service_type_id, -1);
 		g_object_unref (result_set);
 
-		result = tracker_ontology_service_get_by_id (service_type_id);
+		result = tracker_ontology_get_service_by_id (service_type_id);
 	}
 
 	return result;
@@ -2726,7 +2726,7 @@
 	g_return_val_if_fail (service != NULL, NULL);
 
 	/* Do we really need service here? */
-	service_id = tracker_ontology_service_get_id_by_name (service);
+	service_id = tracker_ontology_get_service_id_by_name (service);
 
 	if (service_id == -1) {
 		return NULL;

Modified: branches/indexer-split/src/trackerd/tracker-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-files.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-files.c	Mon Sep 15 11:03:01 2008
@@ -292,7 +292,7 @@
 	}
 
 	/* Get service from mime */
-	value = tracker_ontology_service_get_by_mime (mime);
+	value = tracker_ontology_get_service_by_mime (mime);
 
 	if (value) {
 

Modified: branches/indexer-split/src/trackerd/tracker-metadata.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-metadata.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-metadata.c	Mon Sep 15 11:03:01 2008
@@ -417,7 +417,7 @@
 
 	requested = (strcmp (service_type, "*") == 0 ? NULL : service_type);
 
-	registered = tracker_ontology_registered_field_types (requested);
+	registered = tracker_ontology_get_field_names_registered (requested);
 
 	values = tracker_gslist_to_string_list (registered);
 
@@ -447,7 +447,7 @@
 	tracker_dbus_request_new (request_id,
 				  "DBus request to get registered classes");
 
-	registered = tracker_ontology_registered_service_types ();
+	registered = tracker_ontology_get_service_names_registered ();
 
 	values = tracker_gslist_to_string_list (registered);
 

Modified: branches/indexer-split/src/trackerd/tracker-query-tree.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-query-tree.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-query-tree.c	Mon Sep 15 11:03:01 2008
@@ -862,7 +862,7 @@
 		/* Update service's parent count too (if it has a
                  * parent).
                  */
-		parent_id = tracker_ontology_service_get_parent_id_by_id (rank.service_type_id);
+		parent_id = tracker_ontology_get_service_parent_id_by_id (rank.service_type_id);
 
 		if (parent_id != -1) {
                         p = g_hash_table_lookup (table, GINT_TO_POINTER (parent_id));

Modified: branches/indexer-split/src/trackerd/tracker-rdf-query.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-rdf-query.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-rdf-query.c	Mon Sep 15 11:03:01 2008
@@ -1103,7 +1103,7 @@
 	int type;
 		
 	result = g_string_new ("");
-	type = tracker_ontology_service_get_id_by_name (service);
+	type = tracker_ontology_get_service_id_by_name (service);
 
 	switch (type) {
 

Modified: branches/indexer-split/src/trackerd/tracker-search.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-search.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-search.c	Mon Sep 15 11:03:01 2008
@@ -547,7 +547,7 @@
 
 		g_value_init (&value, G_TYPE_STRING);
 		g_value_take_string (&value, 
-				     tracker_ontology_service_get_by_id (count.service_type_id));
+				     tracker_ontology_get_service_by_id (count.service_type_id));
 		_tracker_db_result_set_set_value (result_set, 0, &value);
 		g_value_unset (&value);
 

Modified: branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c
==============================================================================
--- branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c	(original)
+++ branches/indexer-split/tests/libtracker-common/tracker-ontology-test.c	Mon Sep 15 11:03:01 2008
@@ -188,9 +188,9 @@
 {
 	gint result_int;
 
-	result_int = tracker_ontology_service_get_id_by_name ("Test service");
+	result_int = tracker_ontology_get_service_id_by_name ("Test service");
 	g_assert_cmpint (result_int, ==, 0);
-	result_int = tracker_ontology_service_get_id_by_name ("trash");
+	result_int = tracker_ontology_get_service_id_by_name ("trash");
 	g_assert_cmpint (result_int, ==, -1);
 }
 
@@ -200,10 +200,10 @@
 {
 	gchar *result_string;
 
-	result_string = tracker_ontology_service_get_by_id (0);
+	result_string = tracker_ontology_get_service_by_id (0);
 	g_assert ( g_str_equal (result_string, "Test service"));
 	g_free (result_string);
-	result_string = tracker_ontology_service_get_by_id (20);
+	result_string = tracker_ontology_get_service_by_id (20);
 	g_assert (!result_string);
 }
 
@@ -213,10 +213,10 @@
 {
 	gchar *result_string;
 
-	result_string = tracker_ontology_service_get_parent_by_id (0);
+	result_string = tracker_ontology_get_service_parent_by_id (0);
 	g_assert ( g_str_equal (result_string, "Parent service"));
 	g_free (result_string);
-	result_string = tracker_ontology_service_get_parent_by_id (1);
+	result_string = tracker_ontology_get_service_parent_by_id (1);
 	g_assert (!result_string);
 }
 
@@ -225,9 +225,9 @@
 {
 	gint result_int;
 
-	result_int = tracker_ontology_service_get_parent_id_by_id (0);
+	result_int = tracker_ontology_get_service_parent_id_by_id (0);
 	g_assert_cmpint (result_int, ==, 1);
-	result_int = tracker_ontology_service_get_parent_id_by_id (1);
+	result_int = tracker_ontology_get_service_parent_id_by_id (1);
 	g_assert_cmpint (result_int, ==, -1);
 }
 
@@ -236,10 +236,10 @@
 {
 	gchar *result_string;
 
-	result_string = tracker_ontology_service_get_parent ("Test service");
+	result_string = tracker_ontology_get_service_parent ("Test service");
 	g_assert (g_str_equal (result_string, "Parent service"));
 	g_free (result_string);
-	result_string = tracker_ontology_service_get_parent ("Parent service");
+	result_string = tracker_ontology_get_service_parent ("Parent service");
 	g_assert (!result_string);
 }
 
@@ -248,15 +248,15 @@
 {
 	gchar *value;
 
-	value = tracker_ontology_service_get_by_mime ("application/rtf");
+	value = tracker_ontology_get_service_by_mime ("application/rtf");
 	g_assert ( g_str_equal ("Parent service", value));
 	g_free (value);
 
-	value = tracker_ontology_service_get_by_mime ("images/jpeg");
+	value = tracker_ontology_get_service_by_mime ("images/jpeg");
 	g_assert ( g_str_equal ("Parent service", value));
 	g_free (value);
 
-	value = tracker_ontology_service_get_by_mime ("noexists/bla");
+	value = tracker_ontology_get_service_by_mime ("noexists/bla");
 	g_assert ( g_str_equal ("Other", value));
 	g_free (value);
 }
@@ -266,11 +266,11 @@
 {
 	TrackerService *result_def;
 
-	result_def = tracker_ontology_service_get_by_name ("Test service");
+	result_def = tracker_ontology_get_service_by_name ("Test service");
 	g_assert (test_cmp_servicedef_equals (result_def, expected_results->def));
-	result_def = tracker_ontology_service_get_by_name ("No no no");
+	result_def = tracker_ontology_get_service_by_name ("No no no");
 	g_assert (!test_cmp_servicedef_equals (result_def, expected_results->def));
-	result_def = tracker_ontology_service_get_by_name ("Parent service");
+	result_def = tracker_ontology_get_service_by_name ("Parent service");
 	g_assert (test_cmp_servicedef_equals (result_def, expected_results->parent_def));
 }
 
@@ -279,9 +279,9 @@
 {
 	TrackerDBType result_db;
 
-	result_db = tracker_ontology_service_get_db_by_name ("Test service");
+	result_db = tracker_ontology_get_service_db_by_name ("Test service");
 	g_assert (result_db == TRACKER_DB_TYPE_FILES); // ????? HARDCODED IN tracker-ontology!!!!!
-	result_db = tracker_ontology_service_get_db_by_name ("trash");
+	result_db = tracker_ontology_get_service_db_by_name ("trash");
 	g_assert (result_db == TRACKER_DB_TYPE_FILES);
 }
 
@@ -329,7 +329,7 @@
 {
 	GSList *service_types = NULL;
 
-	service_types = tracker_ontology_registered_service_types ();
+	service_types = tracker_ontology_get_service_names_registered ();
 
 	g_assert_cmpint (7, ==, g_slist_length (service_types));
 	
@@ -345,7 +345,7 @@
 	GSList *field_types = NULL;
 	
 	/* All registered field types */
-	field_types = tracker_ontology_registered_field_types (NULL);
+	field_types = tracker_ontology_get_field_names_registered (NULL);
 
 	g_assert_cmpint (1 ,==, g_slist_length (field_types));
 
@@ -355,12 +355,12 @@
 	g_slist_free (field_types);
 
 	/* Music field types */
-	field_types = tracker_ontology_registered_field_types ("Music");
+	field_types = tracker_ontology_get_field_names_registered ("Music");
 
 	g_assert (!field_types);
 
 	/* App field types */
-	field_types = tracker_ontology_registered_field_types ("Applications");
+	field_types = tracker_ontology_get_field_names_registered ("Applications");
 
 	g_assert_cmpint (1 ,==, g_slist_length (field_types));
 



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