Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D36EF418C25 for ; Thu, 15 Apr 2010 23:38:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5iKU0DIEB-Ag for ; Thu, 15 Apr 2010 23:38:54 -0700 (PDT) Received: from homiemail-a20.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id F38EC431FC1 for ; Thu, 15 Apr 2010 23:38:53 -0700 (PDT) Received: from localhost.localdomain (unknown [195.190.188.219]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id BBF3E7EC060; Thu, 15 Apr 2010 23:38:52 -0700 (PDT) From: Sebastian Spaeth To: Notmuch developer list Subject: [PATCH 1/3] query.cc: allow to return query results unsorted Date: Fri, 16 Apr 2010 08:38:46 +0200 Message-Id: <1271399928-6166-1-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <87eiifj433.fsf@SSpaeth.de> References: <87eiifj433.fsf@SSpaeth.de> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 06:38:55 -0000 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 --- lib/notmuch.h | 3 ++- lib/query.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index a7e66dd..bae48a6 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -346,7 +346,8 @@ notmuch_query_create (notmuch_database_t *database, 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. */ diff --git a/lib/query.cc b/lib/query.cc index 10f8dc8..4148f9b 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -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_UNSORTED: + break; } #if DEBUG_QUERY -- 1.7.0.4