[epiphany/history-rewrite-second: 22/28] history-service: use the sort type during queries



commit 14dd9f4213204475713798f35091c4d69c28af2d
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Jan 10 19:18:47 2012 +0200

    history-service: use the sort type during queries

 lib/history/ephy-history-service-urls-table.c |   10 ++++++++++
 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 c2178ee..c11713b 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 ? ");
   }



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