1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-29 07:51:04 +02:00

* mu-cmd / mu-cmd-find: get thread info for s-exps output too

This commit is contained in:
Dirk-Jan C. Binnema 2011-08-20 11:58:16 +03:00
parent 7c4d3c6539
commit 26d9bc904d
2 changed files with 12 additions and 7 deletions

View File

@ -48,8 +48,8 @@
static gboolean output_links (MuMsgIter *iter, const char* linksdir, static gboolean output_links (MuMsgIter *iter, const char* linksdir,
gboolean clearlinks,size_t *count); gboolean clearlinks,size_t *count);
static gboolean output_sexp (MuMsgIter *iter, gboolean include_unreadable, static gboolean output_sexp (MuMsgIter *iter, gboolean threads,
size_t *count); gboolean include_unreadable, size_t *count);
static gboolean output_xml (MuMsgIter *iter,gboolean include_unreadable, static gboolean output_xml (MuMsgIter *iter,gboolean include_unreadable,
size_t *count); size_t *count);
static gboolean output_plain (MuMsgIter *iter, const char *fields, static gboolean output_plain (MuMsgIter *iter, const char *fields,
@ -123,7 +123,8 @@ output_query_results (MuMsgIter *iter, MuConfig *opts, size_t *count)
case MU_CONFIG_FORMAT_XML: case MU_CONFIG_FORMAT_XML:
return output_xml (iter, opts->include_unreadable, count); return output_xml (iter, opts->include_unreadable, count);
case MU_CONFIG_FORMAT_SEXP: case MU_CONFIG_FORMAT_SEXP:
return output_sexp (iter, opts->include_unreadable, count); return output_sexp (iter, opts->threads,
opts->include_unreadable, count);
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE; return FALSE;
@ -716,7 +717,8 @@ print_attr_xml (const char* elm, const char *str)
static gboolean static gboolean
output_sexp (MuMsgIter *iter, gboolean include_unreadable, size_t *count) output_sexp (MuMsgIter *iter, gboolean threads,
gboolean include_unreadable, size_t *count)
{ {
MuMsgIter *myiter; MuMsgIter *myiter;
size_t mycount; size_t mycount;
@ -728,6 +730,7 @@ output_sexp (MuMsgIter *iter, gboolean include_unreadable, size_t *count)
MuMsg *msg; MuMsg *msg;
char *sexp; char *sexp;
const MuMsgIterThreadInfo *ti;
msg = mu_msg_iter_get_msg (iter, NULL); /* don't unref */ msg = mu_msg_iter_get_msg (iter, NULL); /* don't unref */
if (!msg) if (!msg)
@ -737,8 +740,10 @@ output_sexp (MuMsgIter *iter, gboolean include_unreadable, size_t *count)
* readable (ie, live also outside the database) */ * readable (ie, live also outside the database) */
if (!include_unreadable && !mu_msg_is_readable (msg)) if (!include_unreadable && !mu_msg_is_readable (msg))
continue; continue;
sexp = mu_msg_to_sexp (msg, TRUE); ti = threads ? mu_msg_iter_get_thread_info (iter) : NULL;
sexp = mu_msg_to_sexp (msg, ti, TRUE);
fputs (sexp, stdout); fputs (sexp, stdout);
g_free (sexp); g_free (sexp);

View File

@ -46,7 +46,7 @@
static gboolean static gboolean
view_msg_sexp (MuMsg *msg) view_msg_sexp (MuMsg *msg)
{ {
fputs (mu_msg_to_sexp (msg, FALSE), stdout); fputs (mu_msg_to_sexp (msg, NULL, FALSE), stdout);
return TRUE; return TRUE;
} }