tracker r2955 - in trunk: . src/libtracker-data src/tracker-utils



Author: mottela
Date: Mon Feb 23 11:28:14 2009
New Revision: 2955
URL: http://svn.gnome.org/viewvc/tracker?rev=2955&view=rev

Log:
Use the collation field for sorting instead of the display field

Modified:
   trunk/ChangeLog
   trunk/src/libtracker-data/tracker-data-search.c
   trunk/src/libtracker-data/tracker-rdf-query.c
   trunk/src/tracker-utils/tracker-query.c

Modified: trunk/src/libtracker-data/tracker-data-search.c
==============================================================================
--- trunk/src/libtracker-data/tracker-data-search.c	(original)
+++ trunk/src/libtracker-data/tracker-data-search.c	Mon Feb 23 11:28:14 2009
@@ -788,7 +788,7 @@
 
 		g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
 		g_string_append_printf (sql_order, " %s %s",
-					tracker_field_data_get_select_field (fd),
+					tracker_field_data_get_order_field (fd),
 					order_desc ? "DESC" : "ASC" );
 	}
 
@@ -914,7 +914,7 @@
 
 		g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
 		g_string_append_printf (sql_order, " %s %s",
-					tracker_field_data_get_select_field (fd),
+					tracker_field_data_get_order_field (fd),
 					order_desc ? "DESC" : "ASC" );
 		g_string_append_printf (sql_group, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
 
@@ -1074,7 +1074,7 @@
 
 		g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
 		g_string_append_printf (sql_order, " %s %s",
-					tracker_field_data_get_select_field (fd),
+					tracker_field_data_get_order_field (fd),
 					order_desc ? "DESC" : "ASC" );
 		g_string_append_printf (sql_group, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
 

Modified: trunk/src/libtracker-data/tracker-rdf-query.c
==============================================================================
--- trunk/src/libtracker-data/tracker-rdf-query.c	(original)
+++ trunk/src/libtracker-data/tracker-rdf-query.c	Mon Feb 23 11:28:14 2009
@@ -1338,7 +1338,7 @@
 			}
 
 			g_string_append_printf (data.sql_order, "%s %s",
-						tracker_field_data_get_select_field (field_data),
+						tracker_field_data_get_order_field (field_data),
 						sort_desc ? "DESC" : "ASC");
 		}
 	}

Modified: trunk/src/tracker-utils/tracker-query.c
==============================================================================
--- trunk/src/tracker-utils/tracker-query.c	(original)
+++ trunk/src/tracker-utils/tracker-query.c	Mon Feb 23 11:28:14 2009
@@ -42,6 +42,7 @@
 static gchar	    **fields;
 static gchar	     *service;
 static gchar	    **keywords;
+static gchar        **order;
 static gint	      limit = 512;
 static gint	      offset;
 
@@ -70,6 +71,10 @@
 	  N_("Adds a keyword filter"),
 	  NULL
 	},
+	{ "order", 'r', 0, G_OPTION_ARG_STRING_ARRAY, &order,
+	  N_("Adds an order field"),
+	  NULL
+	},
 	{ G_OPTION_REMAINING, 0, 0,
 	  G_OPTION_ARG_STRING_ARRAY, &fields,
 	  N_("Metadata Fields"),
@@ -223,7 +228,7 @@
 				      offset,
 				      limit,
 				      FALSE,
-				      NULL,
+				      order,
 				      FALSE,
 				      &error);
 	g_free (buffer);



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