mirror of https://github.com/djcb/mu.git
* enable the --threads/t argument for mu-find / queries
This commit is contained in:
parent
1e945e301f
commit
9a5888f7c8
|
@ -162,6 +162,8 @@ config_options_group_find (MuConfig *opts)
|
||||||
"fields to display in the output", NULL},
|
"fields to display in the output", NULL},
|
||||||
{"sortfield", 's', 0, G_OPTION_ARG_STRING, &opts->sortfield,
|
{"sortfield", 's', 0, G_OPTION_ARG_STRING, &opts->sortfield,
|
||||||
"field to sort on", NULL},
|
"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,
|
{"bookmark", 'b', 0, G_OPTION_ARG_STRING, &opts->bookmark,
|
||||||
"use a bookmarked query", NULL},
|
"use a bookmarked query", NULL},
|
||||||
{"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending,
|
{"descending", 'z', 0, G_OPTION_ARG_NONE, &opts->descending,
|
||||||
|
|
|
@ -94,10 +94,11 @@ struct _MuConfig {
|
||||||
* default */
|
* default */
|
||||||
int max_msg_size; /* maximum size for message files */
|
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 *fields; /* fields to show in output */
|
||||||
char *sortfield; /* field to sort by (string) */
|
char *sortfield; /* field to sort by (string) */
|
||||||
gboolean descending; /* sort descending? */
|
gboolean descending; /* sort descending? */
|
||||||
|
gboolean threads; /* show message threads */
|
||||||
gboolean summary; /* include a summary? */
|
gboolean summary; /* include a summary? */
|
||||||
char *bookmark; /* use bookmark */
|
char *bookmark; /* use bookmark */
|
||||||
char *formatstr; /* output type
|
char *formatstr; /* output type
|
||||||
|
|
|
@ -333,7 +333,7 @@ mu_query_preprocess (const char *query)
|
||||||
|
|
||||||
|
|
||||||
MuMsgIter*
|
MuMsgIter*
|
||||||
mu_query_run (MuQuery *self, const char* searchexpr,
|
mu_query_run (MuQuery *self, const char* searchexpr, gboolean threads,
|
||||||
MuMsgFieldId sortfieldid, gboolean ascending,
|
MuMsgFieldId sortfieldid, gboolean ascending,
|
||||||
GError **err)
|
GError **err)
|
||||||
{
|
{
|
||||||
|
@ -363,7 +363,7 @@ mu_query_run (MuQuery *self, const char* searchexpr,
|
||||||
enq.set_cutoff(0,0);
|
enq.set_cutoff(0,0);
|
||||||
|
|
||||||
return mu_msg_iter_new ((XapianEnquire*)&enq,
|
return mu_msg_iter_new ((XapianEnquire*)&enq,
|
||||||
self->_db.get_doccount());
|
self->_db.get_doccount(), threads);
|
||||||
|
|
||||||
} MU_XAPIAN_CATCH_BLOCK_RETURN(NULL);
|
} MU_XAPIAN_CATCH_BLOCK_RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ char* mu_query_version (MuQuery *store)
|
||||||
*
|
*
|
||||||
* @param self a valid MuQuery instance
|
* @param self a valid MuQuery instance
|
||||||
* @param expr the search expression
|
* @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
|
* @param sortfield the field id to sort by or MU_MSG_FIELD_ID_NONE if
|
||||||
* sorting is not desired
|
* sorting is not desired
|
||||||
* @param ascending if TRUE sort in ascending (A-Z) order, otherwise,
|
* @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
|
* @return a MuMsgIter instance you can iterate over, or NULL in
|
||||||
* case of error
|
* 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,
|
MuMsgFieldId sortfieldid, gboolean ascending,
|
||||||
GError **err)
|
GError **err)
|
||||||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
Loading…
Reference in New Issue