Commit 6606c064 authored by Mikael Ottela's avatar Mikael Ottela

Use the collation field for sorting instead of the display field

svn path=/trunk/; revision=2955
parent fd757179
2009-02-23 Mikael Ottela <mikael.ottela@ixonos.com>
* src/tracker-utils/tracker-query.c
* src/libtracker-data/tracker-data-search.c
* src/libtracker-data/tracker-rdf-query.c: Use the
MetadataCollation for sorting rather than the display field.
2009-02-23 Martyn Russell <martyn@imendio.com>
* python/deskbar-handler/README: Removed. Was 0 bytes.
......
......@@ -788,7 +788,7 @@ tracker_data_search_get_unique_values (const gchar *service_type,
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 @@ tracker_data_search_get_unique_values_with_count (const gchar *service_type,
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 @@ tracker_data_search_get_unique_values_with_count_and_sum (const gchar *ser
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));
......
......@@ -1338,7 +1338,7 @@ tracker_rdf_query_to_sql (TrackerDBInterface *iface,
}
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");
}
}
......
......@@ -42,6 +42,7 @@ static gchar *search;
static gchar **fields;
static gchar *service;
static gchar **keywords;
static gchar **order;
static gint limit = 512;
static gint offset;
......@@ -70,6 +71,10 @@ static GOptionEntry entries[] = {
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 @@ main (int argc, char **argv)
offset,
limit,
FALSE,
NULL,
order,
FALSE,
&error);
g_free (buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment