X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fquery.cc;h=8cf0a077e5e74e54267d0470a25b51fa9e84475d;hb=65a6b86873a471bb87d30a8617a87857103cd8b6;hp=5275b5a24fe620ed2dcef5fd2d87a9b78a1860a6;hpb=6b440a0adf327fa9c3f5e3dcc84f9356c62a4580;p=notmuch diff --git a/lib/query.cc b/lib/query.cc index 5275b5a2..8cf0a077 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -98,7 +98,7 @@ notmuch_query_create (notmuch_database_t *notmuch, } const char * -notmuch_query_get_query_string (notmuch_query_t *query) +notmuch_query_get_query_string (const notmuch_query_t *query) { return query->query_string; } @@ -117,7 +117,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort) } notmuch_sort_t -notmuch_query_get_sort (notmuch_query_t *query) +notmuch_query_get_sort (const notmuch_query_t *query) { return query->sort; } @@ -618,10 +618,14 @@ notmuch_query_count_threads (notmuch_query_t *query) GHashTable *hash; unsigned int count; notmuch_sort_t sort; + notmuch_status_t status; sort = query->sort; query->sort = NOTMUCH_SORT_UNSORTED; - messages = notmuch_query_search_messages (query); + status = notmuch_query_search_messages_st (query, &messages); + if (status) + return 0; + query->sort = sort; if (messages == NULL) return 0; @@ -656,7 +660,7 @@ notmuch_query_count_threads (notmuch_query_t *query) } notmuch_database_t * -notmuch_query_get_database (notmuch_query_t *query) +notmuch_query_get_database (const notmuch_query_t *query) { return query->notmuch; }