* enable the --threads/t argument for mu-find / queries

This commit is contained in:
Dirk-Jan C. Binnema 2011-06-19 21:03:33 +03:00
parent 1e945e301f
commit 9a5888f7c8
4 changed files with 8 additions and 4 deletions

View File

@ -162,6 +162,8 @@ config_options_group_find (MuConfig *opts)
"fields to display in the output", NULL},
{"sortfield", 's', 0, G_OPTION_ARG_STRING, &opts->sortfield,
"field to sort on", NULL},
{"threads", 't', 0, G_OPTION_ARG_NONE, &opts->threads,
"show message threads", NULL},
{"bookmark", 'b', 0, G_OPTION_ARG_STRING, &opts->bookmark,
"use a bookmarked query", NULL},
{"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending,

View File

@ -94,10 +94,11 @@ struct _MuConfig {
* default */
int max_msg_size; /* maximum size for message files */
/* options for querying (and view-> 'summary') */
/* options for querying 'find' (and view-> 'summary') */
char *fields; /* fields to show in output */
char *sortfield; /* field to sort by (string) */
gboolean descending; /* sort descending? */
gboolean threads; /* show message threads */
gboolean summary; /* include a summary? */
char *bookmark; /* use bookmark */
char *formatstr; /* output type

View File

@ -333,7 +333,7 @@ mu_query_preprocess (const char *query)
MuMsgIter*
mu_query_run (MuQuery *self, const char* searchexpr,
mu_query_run (MuQuery *self, const char* searchexpr, gboolean threads,
MuMsgFieldId sortfieldid, gboolean ascending,
GError **err)
{
@ -363,7 +363,7 @@ mu_query_run (MuQuery *self, const char* searchexpr,
enq.set_cutoff(0,0);
return mu_msg_iter_new ((XapianEnquire*)&enq,
self->_db.get_doccount());
self->_db.get_doccount(), threads);
} MU_XAPIAN_CATCH_BLOCK_RETURN(NULL);
}

View File

@ -69,6 +69,7 @@ char* mu_query_version (MuQuery *store)
*
* @param self a valid MuQuery instance
* @param expr the search expression
* @param threads calculate message-threads
* @param sortfield the field id to sort by or MU_MSG_FIELD_ID_NONE if
* sorting is not desired
* @param ascending if TRUE sort in ascending (A-Z) order, otherwise,
@ -80,7 +81,7 @@ char* mu_query_version (MuQuery *store)
* @return a MuMsgIter instance you can iterate over, or NULL in
* case of error
*/
MuMsgIter* mu_query_run (MuQuery *self, const char* expr,
MuMsgIter* mu_query_run (MuQuery *self, const char* expr, gboolean threads,
MuMsgFieldId sortfieldid, gboolean ascending,
GError **err)
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;