X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fquery.cc;h=f53215dbaf5902fca51d3c7dd5ac3628802ded00;hb=110694b00b79793b3c09a0349c0ff7608df551d6;hp=9cedb6a8440ae907ac83f9d0b2ac98e8a9f5c9aa;hpb=736ac26407914425a9c94e86616225292cf716dd;p=notmuch diff --git a/lib/query.cc b/lib/query.cc index 9cedb6a8..f53215db 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -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; @@ -654,3 +658,9 @@ notmuch_query_count_threads (notmuch_query_t *query) return count; } + +notmuch_database_t * +notmuch_query_get_database (notmuch_query_t *query) +{ + return query->notmuch; +}