From f7b49d658ad507b72d01b06d56975dba0b7cafc8 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 12 Nov 2009 22:35:16 -0800 Subject: notmuch search: Add support for a --reverse option to reverse sort order. Note that the difference between thread results in date order and thread results in reverse-date order is not simply a matter of reversing the final results. When sorting in date order, the threads are sorted by the oldest message in the thread. When sorting in reverse-date order, the threads are sorted by the newest message in the thread. This difference means that we might want an explicit option in the interface to reverse the order, (even though the default will be to display the inbox in date order and global searches in reverse-date order). --- lib/query.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/query.cc') diff --git a/lib/query.cc b/lib/query.cc index e853d4ec..7c1df90c 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -61,7 +61,7 @@ notmuch_query_create (notmuch_database_t *notmuch, query->query_string = talloc_strdup (query, query_string); - query->sort = NOTMUCH_SORT_DATE_OLDEST_FIRST; + query->sort = NOTMUCH_SORT_DATE; return query; } @@ -123,10 +123,10 @@ notmuch_query_search_messages (notmuch_query_t *query, } switch (query->sort) { - case NOTMUCH_SORT_DATE_OLDEST_FIRST: + case NOTMUCH_SORT_DATE: enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, FALSE); break; - case NOTMUCH_SORT_DATE_NEWEST_FIRST: + case NOTMUCH_SORT_DATE_REVERSE: enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, TRUE); break; case NOTMUCH_SORT_MESSAGE_ID: -- cgit v1.2.3