unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [Patch v4 8/9] lib: migrate thread.cc to new query_search API
Date: Sun, 27 Sep 2015 12:32:02 -0300	[thread overview]
Message-ID: <1443367923-11867-9-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1443367923-11867-1-git-send-email-david@tethera.net>

here we rely on thread_id_query being attached to the local talloc
context, so no new cleanup code is needed.
---
 lib/thread.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/thread.cc b/lib/thread.cc
index c8e58c3..0c937d7 100644
--- a/lib/thread.cc
+++ b/lib/thread.cc
@@ -447,6 +447,7 @@ _notmuch_thread_create (void *ctx,
 
     notmuch_messages_t *messages;
     notmuch_message_t *message;
+    notmuch_status_t status;
 
     seed_message = _notmuch_message_create (local, notmuch, seed_doc_id, NULL);
     if (! seed_message)
@@ -504,9 +505,11 @@ _notmuch_thread_create (void *ctx,
      * oldest or newest subject is desired. */
     notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST);
 
-    /* XXX: this should use the _st version, but it needs an error path
-     */
-    for (messages = notmuch_query_search_messages (thread_id_query);
+    status = notmuch_query_search_messages_st (thread_id_query, &messages);
+    if (status)
+	goto DONE;
+
+    for (;
 	 notmuch_messages_valid (messages);
 	 notmuch_messages_move_to_next (messages))
     {
-- 
2.5.3

  parent reply	other threads:[~2015-09-27 15:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27 15:31 v4 of count patches, plus convert remaining deprecated APIs David Bremner
2015-09-27 15:31 ` [Patch v4 1/9] lib: move query variable to function scope David Bremner
2015-09-27 15:31 ` [Patch v4 2/9] cli/count: simplify and document return value of print_count David Bremner
2015-09-27 15:31 ` [Patch v4 3/9] lib: add versions of n_q_count_{message, threads} with status return David Bremner
2015-10-05 18:22   ` Jani Nikula
2015-09-27 15:31 ` [Patch v4 4/9] cli: update to use new count API David Bremner
2015-10-05 18:25   ` Jani Nikula
2015-09-27 15:31 ` [Patch v4 5/9] ruby: " David Bremner
2015-09-27 15:32 ` [Patch v4 6/9] python: update bindings for " David Bremner
2015-09-27 15:32 ` [Patch v4 7/9] lib: migrate notmuch_database_upgrade to new query_search API David Bremner
2015-10-05 18:27   ` Jani Nikula
2015-09-27 15:32 ` David Bremner [this message]
2015-10-05 18:27   ` [Patch v4 8/9] lib: migrate thread.cc " Jani Nikula
2015-09-27 15:32 ` [Patch v4 9/9] ruby: use " David Bremner
2015-10-05 23:30 ` v4 of count patches, plus convert remaining deprecated APIs David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443367923-11867-9-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).