* small updates for mu_query API changes

This commit is contained in:
djcb 2012-12-25 17:34:57 +02:00
parent 7856ac939e
commit ba6955be21
3 changed files with 9 additions and 12 deletions

View File

@ -123,8 +123,6 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err)
}
qflags = MU_QUERY_FLAG_NONE;
if (opts->threads)
qflags |= MU_QUERY_FLAG_THREADS;
if (opts->reverse)
qflags |= MU_QUERY_FLAG_DESCENDING;
if (opts->skip_dups)
@ -574,7 +572,12 @@ output_query_results (MuMsgIter *iter, MuConfig *opts, GError **err)
msg = get_message (iter, opts->after);
if (!msg)
break;
/* { */
/* const char* thread_id; */
/* thread_id = mu_msg_iter_get_thread_id (iter); */
/* g_print ("%s ", thread_id ? thread_id : "<none>"); */
/* } */
rv = output_func (msg, iter, opts, err);
if (!rv)
break;

View File

@ -652,7 +652,7 @@ cmd_contacts (ServerContext *ctx, GSList *args, GError **err)
static unsigned
print_sexps (MuMsgIter *iter, gboolean threads, unsigned maxnum)
print_sexps (MuMsgIter *iter, unsigned maxnum)
{
unsigned u;
u = 0;
@ -665,8 +665,7 @@ print_sexps (MuMsgIter *iter, gboolean threads, unsigned maxnum)
if (mu_msg_is_readable (msg)) {
char *sexp;
const MuMsgIterThreadInfo* ti;
ti = threads ? mu_msg_iter_get_thread_info (iter) : NULL;
ti = mu_msg_iter_get_thread_info (iter);
sexp = mu_msg_to_sexp (msg, mu_msg_iter_get_docid (iter),
ti, MU_MSG_OPTION_HEADERS_ONLY);
print_expr ("%s", sexp);
@ -863,9 +862,6 @@ get_find_params (GSList *args, MuMsgFieldId *sortfield,
/* flags */
*qflags = MU_QUERY_FLAG_NONE;
if (get_bool_from_args (args, "threads", TRUE, NULL))
*qflags |= MU_QUERY_FLAG_THREADS;
/* maximum number of results */
maxnumstr = get_string_from_args (args, "maxnum", TRUE, NULL);
*maxnum = maxnumstr ? atoi (maxnumstr) : 0;
@ -923,9 +919,7 @@ cmd_find (ServerContext *ctx, GSList *args, GError **err)
* will ensure that the output of two finds will not be
* mixed. */
print_expr ("(:erase t)");
foundnum = print_sexps (iter,
qflags & MU_QUERY_FLAG_THREADS,
maxnum > 0 ? maxnum : G_MAXINT32);
foundnum = print_sexps (iter, maxnum);
print_expr ("(:found %u)", foundnum);
mu_msg_iter_destroy (iter);

View File

@ -71,7 +71,7 @@ run_and_get_iter (const char *xpath, const char *query)
g_assert (query);
iter = mu_query_run (mquery, query, MU_MSG_FIELD_ID_DATE,
-1, MU_QUERY_FLAG_THREADS, NULL);
-1, MU_QUERY_FLAG_NONE, NULL);
mu_query_destroy (mquery);
g_assert (iter);