tracker r1962 - in branches/indexer-split: . src/libtracker-common src/tracker-indexer



Author: carlosg
Date: Tue Jul 29 16:01:22 2008
New Revision: 1962
URL: http://svn.gnome.org/viewvc/tracker?rev=1962&view=rev

Log:
2008-07-29  Carlos Garnacho  <carlos imendio com>

        * src/libtracker-common/tracker-ontology.c
        (tracker_ontology_metadata_key_in_service): Valid metadata keys start
        from number 1.
        * src/tracker-indexer/tracker-indexer-db.c (tracker_db_set_metadata):
        Store corresponding metadata into the Services table.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-ontology.c
   branches/indexer-split/src/tracker-indexer/tracker-indexer-db.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	Tue Jul 29 16:01:22 2008
@@ -427,8 +427,8 @@
 		return 0;
 	}
 
-	for (l = tracker_service_get_key_metadata (service), i = 0; 
-	     l; 
+	for (l = tracker_service_get_key_metadata (service), i = 1;
+	     l;
 	     l = l->next, i++) {
 		if (!l->data) {
 			continue;

Modified: branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-indexer-db.c	Tue Jul 29 16:01:22 2008
@@ -227,6 +227,7 @@
 			 const gchar    *parsed_value)
 {
 	TrackerDBInterface *iface;
+	gint metadata_key;
 	gchar *id_str;
 
 	id_str = tracker_guint32_to_string (id);
@@ -273,6 +274,14 @@
 		break;
 	}
 
+	metadata_key = tracker_ontology_metadata_key_in_service (tracker_service_get_name (service),
+								 tracker_field_get_name (field));
+	if (metadata_key > 0) {
+		tracker_db_interface_execute_query (iface, NULL,
+						    "update Services set KeyMetadata%d = '%s' where id = %d",
+						    metadata_key, value, id);
+	}
+
 	g_free (id_str);
 }
 



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