* remove debug output, fix code for cc10, line33

This commit is contained in:
Dirk-Jan C. Binnema 2011-06-24 12:39:46 +03:00
parent ffb6dfae8c
commit 9c6014e40b
3 changed files with 44 additions and 37 deletions

View File

@ -46,13 +46,41 @@ get_recip (GMimeMessage *msg, GMimeRecipientType rtype)
return recep;
}
static gchar*
get_refs_str (GMimeMessage *msg)
{
const gchar *str;
const GMimeReferences *cur;
GMimeReferences *mime_refs;
gchar *rv;
str = g_mime_object_get_header (GMIME_OBJECT(msg),
"References");
if (!str)
return NULL;
mime_refs = g_mime_references_decode (str);
for (rv = NULL, cur = mime_refs; cur;
cur = g_mime_references_get_next(cur)) {
const char* msgid;
msgid = g_mime_references_get_message_id (cur);
rv = g_strdup_printf ("%s%s%s",
rv ? rv : "",
rv ? "," : "",
msgid);
}
g_mime_references_free (mime_refs);
return rv;
}
static gboolean
test_message (GMimeMessage *msg)
{
gchar *val;
const gchar *str;
g_print ("From : %s\n", g_mime_message_get_sender (msg));
val = get_recip (msg, GMIME_RECIPIENT_TYPE_TO);
@ -74,29 +102,12 @@ test_message (GMimeMessage *msg)
g_print ("Msg-id : %s\n", str ? str : "<none>");
{
str = g_mime_object_get_header (GMIME_OBJECT(msg),
"References");
/* get stuff from the 'references' header */
if (str) {
const GMimeReferences *cur;
GMimeReferences *mime_refs;
g_print ("Refs : ");
mime_refs = g_mime_references_decode (str);
for (cur = mime_refs; cur;
cur = g_mime_references_get_next(cur)) {
const char* msgid;
msgid = g_mime_references_get_message_id (cur);
g_print ("%s%s",
cur == mime_refs ? "" : ",",
msgid ? msgid : "<huh?>");
}
g_print ("\n");
g_mime_references_free (mime_refs);
}
gchar *refsstr;
refsstr = get_refs_str (msg);
g_print ("Refs : %s\n", refsstr ? refsstr : "<none>");
g_free (refsstr);
}
return TRUE;
}

View File

@ -554,14 +554,13 @@ print_summary (MuMsgIter *iter)
static void
thread_indent (MuMsgIter *iter, gboolean color)
thread_indent (MuMsgIter *iter)
{
const MuMsgIterThreadInfo *ti;
const char* threadpath;
int i;
gboolean is_root, first_child, empty_parent, is_dup;
ti = mu_msg_iter_get_thread_info (iter);
if (!ti) {
g_warning ("cannot get thread-info for %s",
@ -578,24 +577,18 @@ thread_indent (MuMsgIter *iter, gboolean color)
empty_parent = ti->prop & MU_MSG_ITER_THREAD_PROP_EMPTY_PARENT;
is_dup = ti->prop & MU_MSG_ITER_THREAD_PROP_DUP;
/* count the colons... */
/* FIXME: count the colons... */
for (i = 0; *threadpath; ++threadpath)
i += (*threadpath == ':') ? 1 : 0;
/* indent */
while (i --> 0)
fputs (" ", stdout);
if (color)
fputs (MU_COLOR_YELLOW, stdout);
if (!is_root) {
fputs (first_child ? "`" : "|", stdout);
fputs (empty_parent ? "*> " : is_dup ? "=> " : "-> ", stdout);
}
if (color)
fputs (MU_COLOR_DEFAULT, stdout);
}
@ -606,9 +599,12 @@ output_plain_fields (MuMsgIter *iter, const char *fields, gboolean color,
{
const char* myfields;
size_t len;
/* we reuse the color (whatever that may be)
* for message-priority for threads, too */
ansi_color_maybe (MU_MSG_FIELD_ID_PRIO, color);
if (threads)
thread_indent (iter, color);
thread_indent (iter);
for (myfields = fields, len = 0; *myfields; ++myfields) {

View File

@ -43,7 +43,7 @@ fill_database (const char *testdir)
cmdline = g_strdup_printf ("%s index --muhome=%s --maildir=%s"
" --quiet",
MU_PROGRAM, tmpdir, testdir);
g_print ("%s\n", cmdline);
/* g_print ("%s\n", cmdline); */
g_assert (g_spawn_command_line_sync (cmdline, NULL, NULL,
NULL, NULL));