diff options
author | David Bremner <david@tethera.net> | 2015-09-27 12:31:58 -0300 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2015-10-05 19:51:08 -0300 |
commit | e7b420a85446fa469df77e24c11f8afa06a2592e (patch) | |
tree | 4073ad30ba4bdf7a20eb30a86b292db95105b4e8 /notmuch-search.c | |
parent | 87ee9a53e36f395e73e16da12cb268a708147259 (diff) |
cli: update to use new count API
Essentially replace each call to notmuch_count_* with the corresponding
_st call, followed by print_status_query.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r-- | notmuch-search.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/notmuch-search.c b/notmuch-search.c index 44e582cb..6d08c250 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -121,7 +121,13 @@ do_search_threads (search_context_t *ctx) notmuch_status_t status; if (ctx->offset < 0) { - ctx->offset += notmuch_query_count_threads (ctx->query); + unsigned count; + notmuch_status_t status; + status = notmuch_query_count_threads_st (ctx->query, &count); + if (print_status_query ("notmuch search", ctx->query, status)) + return 1; + + ctx->offset += count; if (ctx->offset < 0) ctx->offset = 0; } @@ -521,7 +527,13 @@ do_search_messages (search_context_t *ctx) notmuch_status_t status; if (ctx->offset < 0) { - ctx->offset += notmuch_query_count_messages (ctx->query); + unsigned count; + notmuch_status_t status; + status = notmuch_query_count_messages_st (ctx->query, &count); + if (print_status_query ("notmuch search", ctx->query, status)) + return 1; + + ctx->offset += count; if (ctx->offset < 0) ctx->offset = 0; } |