X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=6d0e5a63fd81c6b4163860e84b1e6af8258394bb;hb=9a5143abbcfbb008f846329b5c50b9322af5322a;hp=fc78769318cce7d15f0e950a3b638d2f68a6a920;hpb=98ee460eaa98f1428aecf03dd39fcf314e6f62c0;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index fc787693..6d0e5a63 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1000,6 +1000,7 @@ notmuch_database_open_verbose (const char *path, notmuch->term_gen->set_stemmer (Xapian::Stem ("english")); notmuch->value_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP); notmuch->date_range_processor = new ParseTimeValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP); + notmuch->last_mod_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_LAST_MOD, "lastmod:"); notmuch->query_parser->set_default_op (Xapian::Query::OP_AND); notmuch->query_parser->set_database (*notmuch->xapian_db); @@ -1007,6 +1008,7 @@ notmuch_database_open_verbose (const char *path, notmuch->query_parser->set_stemming_strategy (Xapian::QueryParser::STEM_SOME); notmuch->query_parser->add_valuerangeprocessor (notmuch->value_range_processor); notmuch->query_parser->add_valuerangeprocessor (notmuch->date_range_processor); + notmuch->query_parser->add_valuerangeprocessor (notmuch->last_mod_range_processor); for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX_EXTERNAL); i++) { prefix_t *prefix = &BOOLEAN_PREFIX_EXTERNAL[i]; @@ -1085,6 +1087,8 @@ notmuch_database_close (notmuch_database_t *notmuch) notmuch->value_range_processor = NULL; delete notmuch->date_range_processor; notmuch->date_range_processor = NULL; + delete notmuch->last_mod_range_processor; + notmuch->last_mod_range_processor = NULL; return status; } @@ -1437,6 +1441,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, notmuch_message_t *message; char *filename; + /* XXX: this should use the _st version, but needs an error + path */ for (messages = notmuch_query_search_messages (query); notmuch_messages_valid (messages); notmuch_messages_move_to_next (messages)) @@ -2647,7 +2653,7 @@ notmuch_database_get_all_tags (notmuch_database_t *db) } const char * -notmuch_database_status_string (notmuch_database_t *notmuch) +notmuch_database_status_string (const notmuch_database_t *notmuch) { return notmuch->status_string; }