mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
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.
This commit is contained in:
parent
15d949b740
commit
17f9c6a0ef
1 changed files with 3 additions and 1 deletions
4
query.cc
4
query.cc
|
@ -92,7 +92,9 @@ notmuch_query_search (notmuch_query_t *query)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Xapian::Enquire enquire (*notmuch->xapian_db);
|
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::Query string_query, final_query;
|
||||||
Xapian::MSet mset;
|
Xapian::MSet mset;
|
||||||
unsigned int flags = (Xapian::QueryParser::FLAG_BOOLEAN |
|
unsigned int flags = (Xapian::QueryParser::FLAG_BOOLEAN |
|
||||||
|
|
Loading…
Reference in a new issue