]> git.notmuchmail.org Git - notmuch/commitdiff
query.cc: allow to return query results unsorted
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 16 Apr 2010 06:38:46 +0000 (08:38 +0200)
committerCarl Worth <cworth@cworth.org>
Wed, 21 Apr 2010 23:06:05 +0000 (16:06 -0700)
Previously, we always sorted the returned results by some string value,
(newest-to-oldest by default), however in some cases (as when applying
tags to a search result) we are not interested in any special order.

This introduces a NOTMUCH_SORT_UNSORTED value that does just that. It is
not used at the moment anywhere in the code.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
lib/notmuch.h
lib/query.cc

index a7e66dd35c9e69bfa8882b8b2b27b8aee8d99a97..bae48a6589f62868331a3c7d7d70715d12ea706c 100644 (file)
@@ -346,7 +346,8 @@ notmuch_query_create (notmuch_database_t *database,
 typedef enum {
     NOTMUCH_SORT_OLDEST_FIRST,
     NOTMUCH_SORT_NEWEST_FIRST,
 typedef enum {
     NOTMUCH_SORT_OLDEST_FIRST,
     NOTMUCH_SORT_NEWEST_FIRST,
-    NOTMUCH_SORT_MESSAGE_ID
+    NOTMUCH_SORT_MESSAGE_ID,
+    NOTMUCH_SORT_UNSORTED
 } notmuch_sort_t;
 
 /* Specify the sorting desired for this query. */
 } notmuch_sort_t;
 
 /* Specify the sorting desired for this query. */
index 3e20f59c8ce9951a1501ac8b7002e2f0a56df7a1..7e1b6b52984330d82f6c82462f64d02c2450f0f4 100644 (file)
@@ -148,6 +148,8 @@ notmuch_query_search_messages (notmuch_query_t *query)
        case NOTMUCH_SORT_MESSAGE_ID:
            enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);
            break;
        case NOTMUCH_SORT_MESSAGE_ID:
            enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);
            break;
+        case NOTMUCH_SORT_UNSORTED:
+           break;
        }
 
 #if DEBUG_QUERY
        }
 
 #if DEBUG_QUERY