aboutsummaryrefslogtreecommitdiffstats
path: root/lib/history
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-01-11 01:18:47 +0800
committerXan Lopez <xan@igalia.com>2012-03-07 04:49:44 +0800
commitbc31a416164021b133cf5403c53042cd3e94c7e6 (patch)
tree907efd87a1eaf2da0f086b7bbc331c8c6202f9b0 /lib/history
parent52a0d24d40b26f4cae80f09bca19ea40c429cf84 (diff)
downloadgsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar.gz
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar.bz2
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar.lz
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar.xz
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.tar.zst
gsoc2013-epiphany-bc31a416164021b133cf5403c53042cd3e94c7e6.zip
history-service: use the sort type during queries
Diffstat (limited to 'lib/history')
-rw-r--r--lib/history/ephy-history-service-urls-table.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index c2178eee5..c11713b93 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -258,6 +258,16 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *
statement_str = g_string_append (statement_str, "1 ");
+ switch (query->sort_type) {
+ case EPHY_HISTORY_SORT_MV:
+ statement_str = g_string_append (statement_str, "ORDER BY urls.visit_count DESC ");
+ break;
+ case EPHY_HISTORY_SORT_LV:
+ statement_str = g_string_append (statement_str, "ORDER BY urls.visit_count ");
+ default:
+ g_warning ("We don't support this sorting method yet.");
+ }
+
if (query->limit) {
statement_str = g_string_append (statement_str, "LIMIT ? ");
}