summaryrefslogtreecommitdiff
path: root/query.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-24 22:21:57 -0700
committerCarl Worth <cworth@cworth.org>2009-10-24 22:21:57 -0700
commit17f9c6a0ef7fb303c4b60422667ad063d91234bc (patch)
tree6c36aab94338efa9c2d2aab6c1000f66a3b7bb34 /query.cc
parent15d949b7404b322df39e2aae7a5653e4cf8a8dc9 (diff)
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.
Diffstat (limited to 'query.cc')
-rw-r--r--query.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/query.cc b/query.cc
index 5750167..ae986d3 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 |