[Xfce4-commits] <midori:master> Sort completion matches by visits in complete days

Christian Dywan noreply at xfce.org
Sun Jan 24 11:08:01 CET 2010


Updating branch refs/heads/master
         to dc25035e29bb2e33301e903ef37c3fee5444da22 (commit)
       from f6317cd48f68424d5e8794c8d41960be9bf66a05 (commit)

commit dc25035e29bb2e33301e903ef37c3fee5444da22
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Fri Jan 22 22:25:36 2010 +0100

    Sort completion matches by visits in complete days

 midori/midori-locationaction.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index f4fccee..4813fab 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -425,9 +425,9 @@ midori_location_action_popup_timeout_cb (gpointer data)
     db = g_object_get_data (G_OBJECT (action->history), "db");
     /* FIXME: Consider keeping the prepared statement with '...LIKE ?...'
         and prepending/ appending % to the key. */
-    query = sqlite3_mprintf ("SELECT DISTINCT uri, title FROM history WHERE "
+    query = sqlite3_mprintf ("SELECT uri, title FROM history WHERE "
                              "uri LIKE '%%%q%%' OR title LIKE '%%%q%%'"
-                             "ORDER BY date ASC LIMIT %d",
+                             "GROUP BY uri ORDER BY count() DESC LIMIT %d",
                              action->key, action->key, MAX_ITEMS);
     result = sqlite3_prepare_v2 (db, query, -1, &statement, NULL);
     sqlite3_free (query);
@@ -441,7 +441,7 @@ midori_location_action_popup_timeout_cb (gpointer data)
             GdkPixbuf* icon = katze_load_cached_icon ((gchar*)uri, NULL);
             if (!icon)
                 icon = action->default_icon;
-            gtk_list_store_insert_with_values (store, NULL, 0,
+            gtk_list_store_insert_with_values (store, NULL, matches,
                 URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25,
                 FAVICON_COL, icon, -1);
             matches++;



More information about the Xfce4-commits mailing list