[tracker/journal] squash with previous commit



commit 03bc2ac9d66813dcb62ec81395d2a43e278b62d9
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Mar 15 13:59:57 2010 +0100

    squash with previous commit

 src/libtracker-data/tracker-data-update.c |   38 +++++++---------------------
 1 files changed, 10 insertions(+), 28 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 4d4c7b6..346362d 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -87,7 +87,6 @@ struct _TrackerDataUpdateBufferResource {
 struct _TrackerDataUpdateBufferProperty {
 	const gchar *name;
 	GValue value;
-	gint value_id;
 	gint graph;
 	gboolean fts : 1;
 	gboolean date_time : 1;
@@ -287,10 +286,7 @@ cache_table_free (TrackerDataUpdateBufferTable *table)
 
 	for (i = 0; i < table->properties->len; i++) {
 		property = &g_array_index (table->properties, TrackerDataUpdateBufferProperty, i);
-
-		if (property->value_id == 0) {
-			g_value_unset (&property->value);
-		}
+		g_value_unset (&property->value);
 	}
 
 	g_array_free (table->properties, TRUE);
@@ -327,7 +323,6 @@ static void
 cache_insert_value (const gchar            *table_name,
                     const gchar            *field_name,
                     GValue                 *value,
-                    gint                    value_id,
                     gint                    graph,
                     gboolean                multiple_values,
                     gboolean                fts,
@@ -340,13 +335,7 @@ cache_insert_value (const gchar            *table_name,
 	 * long-standing as tracker_property_get_name return value. */
 	property.name = field_name;
 
-	if (value) {
-		property.value = *value;
-		property.value_id = 0;
-	} else {
-		property.value_id = value_id;
-	}
-
+	property.value = *value;
 	property.graph = graph;
 	property.fts = fts;
 	property.date_time = date_time;
@@ -378,7 +367,6 @@ cache_delete_value (const gchar            *table_name,
 
 	property.name = g_strdup (field_name);
 	property.value = *value;
-	property.value_id = 0;
 	property.graph = 0;
 	property.fts = fts;
 	property.date_time = date_time;
@@ -556,12 +544,7 @@ tracker_data_resource_buffer_flush (GError **error)
 				param = 0;
 
 				tracker_db_statement_bind_int (stmt, param++, resource_buffer->id);
-
-				if (property->value_id == 0) {
-					statement_bind_gvalue (stmt, &param, &property->value);
-				} else {
-					tracker_db_statement_bind_int (stmt, param++, property->value_id);
-				}
+				statement_bind_gvalue (stmt, &param, &property->value);
 
 				if (property->graph != 0) {
 					tracker_db_statement_bind_int (stmt, param++, property->graph);
@@ -675,11 +658,7 @@ tracker_data_resource_buffer_flush (GError **error)
 						tracker_db_statement_bind_null (stmt, param++);
 					}
 				} else {
-					if (property->value_id == 0) {
-						statement_bind_gvalue (stmt, &param, &property->value);
-					} else {
-						tracker_db_statement_bind_int (stmt, param++, property->value_id);
-					}
+					statement_bind_gvalue (stmt, &param, &property->value);
 				}
 				if (property->graph != 0) {
 					tracker_db_statement_bind_int (stmt, param++, property->graph);
@@ -910,7 +889,7 @@ cache_create_service_decomposed (TrackerClass *cl,
 	cache_insert_row (cl);
 
 	g_value_set_int (&gvalue, ensure_resource_id (tracker_class_get_uri (cl), NULL));
-	cache_insert_value ("rdfs:Resource_rdf:type", "rdf:type", &gvalue, 0,
+	cache_insert_value ("rdfs:Resource_rdf:type", "rdf:type", &gvalue,
 	                    graph != NULL ? ensure_resource_id (graph, NULL) : graph_id,
 	                    TRUE, FALSE, FALSE);
 
@@ -1251,6 +1230,9 @@ cache_set_metadata_decomposed (TrackerProperty  *property,
 			g_propagate_error (error, new_error);
 			return FALSE;
 		}
+	} else {
+		g_value_init (&gvalue, G_TYPE_INT);
+		g_value_set_int (&gvalue, value_id);
 	}
 
 	if (!value_set_add_value (old_values, &gvalue)) {
@@ -1266,7 +1248,7 @@ cache_set_metadata_decomposed (TrackerProperty  *property,
 		             resource_buffer->subject,
 		             field_name);
 	} else {
-		cache_insert_value (table_name, field_name, value ? &gvalue : NULL, value_id,
+		cache_insert_value (table_name, field_name, &gvalue,
 		                    graph != NULL ? ensure_resource_id (graph, NULL) : graph_id,
 		                    multiple_values, fts,
 		                    tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_DATETIME);
@@ -1515,7 +1497,7 @@ resource_buffer_switch (const gchar *graph,
 
 		g_value_init (&gvalue, G_TYPE_INT);
 		g_value_set_int (&gvalue, tracker_data_update_get_next_modseq ());
-		cache_insert_value ("rdfs:Resource", "tracker:modified", &gvalue, 0,
+		cache_insert_value ("rdfs:Resource", "tracker:modified", &gvalue,
 		                    graph_id,
 		                    FALSE, FALSE, FALSE);
 	}



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