tracker r1338 - branches/indexer-split/src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1338 - branches/indexer-split/src/trackerd
- Date: Fri, 2 May 2008 18:39:10 +0100 (BST)
Author: pvanhoof
Date: Fri May 2 17:39:10 2008
New Revision: 1338
URL: http://svn.gnome.org/viewvc/tracker?rev=1338&view=rev
Log:
Various fixes
Modified:
branches/indexer-split/src/trackerd/tracker-db-sqlite.c
branches/indexer-split/src/trackerd/tracker-xesam-live-search.c
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c Fri May 2 17:39:10 2008
@@ -3274,6 +3274,10 @@
// todo: this is a query for ottela to review
+ // Contract, in @result:
+ // ServiceID is #1
+ // EventType is #2
+
gchar *m_query = g_strdup_printf (
"SELECT E.ServiceID, E.EventType, %s "
"FROM XesamLiveSearches as X, Events as E, %s "
Modified: branches/indexer-split/src/trackerd/tracker-xesam-live-search.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-xesam-live-search.c (original)
+++ branches/indexer-split/src/trackerd/tracker-xesam-live-search.c Fri May 2 17:39:10 2008
@@ -223,9 +223,10 @@
if (ev_i_value == g_value_get_int (&ls_value)) {
GValue ev_type = { 0, };
- const gchar *str = g_value_get_string (&ev_type);
+ const gchar *str;
_tracker_db_result_set_get_value (events, 2, &ev_type);
+ str = g_value_get_string (&ev_type);
if (!strcmp (str, "Update")) {
if (m_modified == NULL)
@@ -262,17 +263,41 @@
while (ls_valid) {
GValue ls_value = { 0, };
+ GValue ev_type = { 0, };
gint ls_i_value;
+ const gchar *str;
_tracker_db_result_set_get_value (result_set, 0, &ls_value);
+ _tracker_db_result_set_get_value (result_set, 1, &ev_type);
+
+ str = g_value_get_string (&ev_type);
ls_i_value = g_value_get_int (&ls_value);
- if (m_added == NULL)
- m_added = g_array_new (FALSE, TRUE, sizeof (guint32));
- g_array_append_val (m_added, ls_i_value);
+ if (!strcmp (str, "Update")) {
+ gboolean noadd = FALSE;
+ guint i;
+
+ if (m_modified == NULL) {
+ m_modified = g_array_new (FALSE, TRUE, sizeof (guint32));
+ } else {
+ for (i = 0 ; i < m_modified->len; i++)
+ if (g_array_index (m_modified, guint32, i) == (guint32) ls_i_value) {
+ noadd = TRUE;
+ break;
+ }
+ }
+ if (!noadd)
+ g_array_append_val (m_modified, ls_i_value);
+ } else {
+ if (m_added == NULL)
+ m_added = g_array_new (FALSE, TRUE, sizeof (guint32));
+ g_array_append_val (m_added, ls_i_value);
+ }
+ g_value_unset (&ev_type);
g_value_unset (&ls_value);
+
ls_valid = tracker_db_result_set_iter_next (result_set);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]