Xapian::QueryParser::FLAG_WILDCARD |
Xapian::QueryParser::FLAG_PURE_NOT);
- if (strcmp (query_string, "") == 0) {
+ if (strcmp (query_string, "") == 0 ||
+ strcmp (query_string, "*") == 0)
+ {
final_query = mail_query;
} else {
string_query = notmuch->query_parser->
case NOTMUCH_SORT_MESSAGE_ID:
enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);
break;
+ case NOTMUCH_SORT_UNSORTED:
+ break;
}
#if DEBUG_QUERY
messages->iterator = mset.begin ();
messages->iterator_end = mset.end ();
+ return &messages->base;
+
} catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred performing query: %s\n",
error.get_msg().c_str());
fprintf (stderr, "Query string was: %s\n", query->query_string);
notmuch->exception_reported = TRUE;
+ talloc_free (messages);
+ return NULL;
}
-
- return &messages->base;
}
notmuch_bool_t
-_notmuch_mset_messages_has_more (notmuch_messages_t *messages)
+_notmuch_mset_messages_valid (notmuch_messages_t *messages)
{
notmuch_mset_messages_t *mset_messages;
mset_messages = (notmuch_mset_messages_t *) messages;
- if (! _notmuch_mset_messages_has_more (&mset_messages->base))
+ if (! _notmuch_mset_messages_valid (&mset_messages->base))
return NULL;
doc_id = *mset_messages->iterator;
}
void
-_notmuch_mset_messages_advance (notmuch_messages_t *messages)
+_notmuch_mset_messages_move_to_next (notmuch_messages_t *messages)
{
notmuch_mset_messages_t *mset_messages;
}
notmuch_bool_t
-notmuch_threads_has_more (notmuch_threads_t *threads)
+notmuch_threads_valid (notmuch_threads_t *threads)
{
notmuch_message_t *message;
if (threads->thread_id)
return TRUE;
- while (notmuch_messages_has_more (threads->messages))
+ while (notmuch_messages_valid (threads->messages))
{
message = notmuch_messages_get (threads->messages);
{
g_hash_table_insert (threads->threads,
xstrdup (threads->thread_id), NULL);
- notmuch_messages_advance (threads->messages);
+ notmuch_messages_move_to_next (threads->messages);
return TRUE;
}
- notmuch_messages_advance (threads->messages);
+ notmuch_messages_move_to_next (threads->messages);
}
threads->thread_id = NULL;
notmuch_thread_t *
notmuch_threads_get (notmuch_threads_t *threads)
{
- if (! notmuch_threads_has_more (threads))
+ if (! notmuch_threads_valid (threads))
return NULL;
return _notmuch_thread_create (threads->query,
threads->query->notmuch,
threads->thread_id,
- threads->query->query_string);
+ threads->query->query_string,
+ threads->query->sort);
}
void
-notmuch_threads_advance (notmuch_threads_t *threads)
+notmuch_threads_move_to_next (notmuch_threads_t *threads)
{
threads->thread_id = NULL;
}
Xapian::QueryParser::FLAG_WILDCARD |
Xapian::QueryParser::FLAG_PURE_NOT);
- if (strcmp (query_string, "") == 0) {
+ if (strcmp (query_string, "") == 0 ||
+ strcmp (query_string, "*") == 0)
+ {
final_query = mail_query;
} else {
string_query = notmuch->query_parser->