tracker r1638 - in branches/xesam-support: . src/libtracker-common src/trackerd



Author: pvanhoof
Date: Wed Jun 11 15:06:51 2008
New Revision: 1638
URL: http://svn.gnome.org/viewvc/tracker?rev=1638&view=rev

Log:
2008-06-11  Philip Van Hoof  <pvanhoof gnome org>

        * src/trackerd/tracker-xesam-live-search.c:
        * src/libtracker-common/tracker-xesam-field.c:
        *src/libtracker-common/tracker-xesam-field.h:
        
        List-field values in get_hit_data



Modified:
   branches/xesam-support/ChangeLog
   branches/xesam-support/src/libtracker-common/tracker-xesam-field.c
   branches/xesam-support/src/libtracker-common/tracker-xesam-field.h
   branches/xesam-support/src/trackerd/tracker-xesam-live-search.c

Modified: branches/xesam-support/src/libtracker-common/tracker-xesam-field.c
==============================================================================
--- branches/xesam-support/src/libtracker-common/tracker-xesam-field.c	(original)
+++ branches/xesam-support/src/libtracker-common/tracker-xesam-field.c	Wed Jun 11 15:06:51 2008
@@ -102,6 +102,18 @@
 			{ TRACKER_XESAM_FIELD_TYPE_LIST_OF_URLS,
 			  "TRACKER_XESAM_FIELD_TYPE_LIST_OF_URLS",
 			  "list of urls" },
+			{ TRACKER_XESAM_FIELD_TYPE_LIST_OF_BOOLEANS,
+			  "TRACKER_XESAM_FIELD_TYPE_LIST_OF_BOOLEANS",
+			  "list of booleans" },
+			{ TRACKER_XESAM_FIELD_TYPE_LIST_OF_DATETIMES,
+			  "TRACKER_XESAM_FIELD_TYPE_LIST_OF_DATETIMES",
+			  "list of datetimes" },
+			{ TRACKER_XESAM_FIELD_TYPE_LIST_OF_FLOATS,
+			  "TRACKER_XESAM_FIELD_TYPE_LIST_OF_FLOATS",
+			  "list of floats" },
+			{ TRACKER_XESAM_FIELD_TYPE_LIST_OF_INTEGERS,
+			  "TRACKER_XESAM_FIELD_TYPE_LIST_OF_INTEGERS",
+			  "list of integers" },
 			{ 0, NULL, NULL }
 		};
 

Modified: branches/xesam-support/src/libtracker-common/tracker-xesam-field.h
==============================================================================
--- branches/xesam-support/src/libtracker-common/tracker-xesam-field.h	(original)
+++ branches/xesam-support/src/libtracker-common/tracker-xesam-field.h	Wed Jun 11 15:06:51 2008
@@ -35,6 +35,10 @@
 	TRACKER_XESAM_FIELD_TYPE_LIST_OF_STRINGS,
 	TRACKER_XESAM_FIELD_TYPE_LIST_OF_URIS,
 	TRACKER_XESAM_FIELD_TYPE_LIST_OF_URLS,
+	TRACKER_XESAM_FIELD_TYPE_LIST_OF_BOOLEANS,
+	TRACKER_XESAM_FIELD_TYPE_LIST_OF_DATETIMES,
+	TRACKER_XESAM_FIELD_TYPE_LIST_OF_FLOATS,
+	TRACKER_XESAM_FIELD_TYPE_LIST_OF_INTEGERS
 } TrackerXesamFieldType;
 
 GType tracker_xesam_field_type_get_type (void) G_GNUC_CONST;

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	Wed Jun 11 15:06:51 2008
@@ -688,6 +688,7 @@
 			switch (data_type) {
 				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_URLS:
 				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_URIS:
+				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_DATETIMES:
 				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_STRINGS: {
 					GValue    *variant;
 					GPtrArray *my_array;
@@ -714,8 +715,35 @@
 
 				}
 				break;
-/*
-				case ARRAY_OF_INT: {
+
+				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_FLOATS: {
+					GValue   *variant;
+					GArray   *my_array;
+					gfloat    float_val;
+
+					if (row->len <= (unsigned int) column) {
+						variant = g_new0 (GValue, 1);
+						g_value_init (variant, 
+							      dbus_g_type_get_collection ("GArray", 
+										     G_TYPE_FLOAT));
+
+						my_array =  g_array_new (FALSE, 
+									 TRUE, 
+									 sizeof (gint));
+						g_value_set_boxed_take_ownership (variant, my_array);
+
+						g_ptr_array_add (row, variant);
+					} else {
+						variant = g_ptr_array_index (row, column);
+						my_array = g_value_get_boxed (variant);
+					}
+
+					float_val = g_value_get_float (&cur_value);
+					g_array_append_val (my_array, float_val);
+				}
+				break;
+
+				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_INTEGERS: {
 					GValue *variant;
 					GArray *my_array;
 					gint    int_val;
@@ -742,7 +770,7 @@
 				}
 				break;
 
-				case ARRAY_OF_BOOLEAN: {
+				case TRACKER_XESAM_FIELD_TYPE_LIST_OF_BOOLEANS: {
 					GValue  *variant;
 					GArray  *my_array;
 					gboolean bool_val;



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