From: Carl Worth Date: Sun, 25 Oct 2009 05:21:57 +0000 (-0700) Subject: Use _find_prefix instead of hard-coded term in notmuch_query_search X-Git-Tag: 0.1~727 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=17f9c6a0ef7fb303c4b60422667ad063d91234bc;p=notmuch.git Use _find_prefix instead of hard-coded term in notmuch_query_search I'm planning to change prefix values soon, which would break code like this. So eliminate the fragility by going through our existing _find_prefix function. --- diff --git a/query.cc b/query.cc index 57501675..ae986d35 100644 --- a/query.cc +++ b/query.cc @@ -92,7 +92,9 @@ notmuch_query_search (notmuch_query_t *query) try { Xapian::Enquire enquire (*notmuch->xapian_db); - Xapian::Query mail_query ("Kmail"); + Xapian::Query mail_query (talloc_asprintf (query, "%s%s", + _find_prefix ("type"), + "mail")); Xapian::Query string_query, final_query; Xapian::MSet mset; unsigned int flags = (Xapian::QueryParser::FLAG_BOOLEAN |