tracker r1617 - in branches/xesam-support: . src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1617 - in branches/xesam-support: . src/trackerd
- Date: Tue, 10 Jun 2008 09:30:32 +0000 (UTC)
Author: pvanhoof
Date: Tue Jun 10 09:30:32 2008
New Revision: 1617
URL: http://svn.gnome.org/viewvc/tracker?rev=1617&view=rev
Log:
2008-06-10 Philip Van Hoof <pvanhoof gnome org>
* src/trackerd/tracker-xesam-live-search.c:
* src/trackerd/tracker-db.c:
Further preparations for get_hit_data, support for fields that
contain a list-value. Added the ServiceID field to the query so
that you can distinguish between actual items-to-return and
records (lines) that will add a item to the list-value field
Modified:
branches/xesam-support/ChangeLog
branches/xesam-support/src/trackerd/tracker-db.c
branches/xesam-support/src/trackerd/tracker-xesam-live-search.c
Modified: branches/xesam-support/src/trackerd/tracker-db.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-db.c (original)
+++ branches/xesam-support/src/trackerd/tracker-db.c Tue Jun 10 09:30:32 2008
@@ -2341,7 +2341,7 @@
g_return_val_if_fail (search_id != NULL, NULL);
//g_return_val_if_fail (fields != NULL, NULL);
- sql_select = g_string_new ("");
+ sql_select = g_string_new ("X.ServiceID, ");
sql_join = g_string_new ("");
while (field_names[i]) {
@@ -2359,7 +2359,8 @@
g_string_append_printf (sql_select, ",");
}
- g_string_append_printf (sql_select, "%s ", tracker_field_data_get_select_field (field_data_list->data) );
+ g_string_append_printf (sql_select, "%s ",
+ tracker_field_data_get_select_field (field_data_list->data) );
i++;
}
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 Tue Jun 10 09:30:32 2008
@@ -590,39 +590,36 @@
while (valid) {
gint column;
GPtrArray *row;
- //GValue value_in = {0, };
+ GValue value_in = {0, };
gboolean insert = FALSE;
+ gint key;
- // remove static here
- static gint key;
+ _tracker_db_result_set_get_value (result_set, 0, &value_in);
- // _tracker_db_result_set_get_value (result_set, 0, &value_in);
- // key must be the first column, as an int, unique per row that
- // must actually be returned. Example:
- //
- // 1, a, b, c, 1
- // 1, a, b, c, 2
- // 1, a, b, c, 3
- // 1, a, b, c, 4
- // 2, a, b, c, 1
- // 3, a, b, c, 1
- // 4, a, b, c, 2
- // 5, a, b, c, 2
- //
- // for:
- //
- //[
- // [a, b, c, [1, 2, 3, 4]]
- // [a, b, c, [1]]
- // [a, b, c, [1]]
- // [a, b, c, [2]]
- // [a, b, c, [2]]
- //]
- //
- // key = g_value_get_int (&value_in);
-
- key++;
+ /* key must be the first column, as an int, unique per row that
+ * must actually be returned. Example:
+ *
+ * 1, a, b, c, 1
+ * 1, a, b, c, 2
+ * 1, a, b, c, 3
+ * 1, a, b, c, 4
+ * 2, a, b, c, 1
+ * 3, a, b, c, 1
+ * 4, a, b, c, 2
+ * 5, a, b, c, 2
+ *
+ * for:
+ *
+ * [
+ * [a, b, c, [1, 2, 3, 4]]
+ * [a, b, c, [1]]
+ * [a, b, c, [1]]
+ * [a, b, c, [2]]
+ * [a, b, c, [2]]
+ * ]
+ **/
+ key = g_value_get_int (&value_in);
row = g_hash_table_lookup (rows, &key);
if (!row) {
@@ -630,7 +627,7 @@
insert = TRUE;
}
- for (column = 0; column < field_count; column++) {
+ for (column = 1; column < field_count + 1; column++) {
GValue cur_value = {0, };
_tracker_db_result_set_get_value (result_set,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]