mirror of https://github.com/djcb/mu.git
* mu-cmd-index.c, mu-cmd-view.c, mu-msg-part.c: fix some overly long functions
This commit is contained in:
parent
51790dd888
commit
b7410acce8
|
@ -255,8 +255,7 @@ mu_cmd_index (MuConfigOptions *opts)
|
|||
mu_index_destroy (midx);
|
||||
|
||||
MU_WRITE_LOG ("processed: %u; updated/new: %u, cleaned-up: %u",
|
||||
(unsigned)stats._processed,
|
||||
(unsigned)stats._updated,
|
||||
(unsigned)stats._processed, (unsigned)stats._updated,
|
||||
(unsigned)stats._cleaned_up);
|
||||
|
||||
if (!opts->quiet)
|
||||
|
|
|
@ -44,39 +44,29 @@ view_file (const gchar *path, const gchar *fields, size_t summary_len)
|
|||
if (!msg)
|
||||
return FALSE;
|
||||
|
||||
field = mu_msg_get_from (msg);
|
||||
if (field)
|
||||
if ((field = mu_msg_get_from (msg)))
|
||||
g_print ("From: %s\n", field);
|
||||
|
||||
field = mu_msg_get_to (msg);
|
||||
if (field)
|
||||
if ((field = mu_msg_get_to (msg)))
|
||||
g_print ("To: %s\n", field);
|
||||
|
||||
field = mu_msg_get_cc (msg);
|
||||
if (field)
|
||||
if ((field = mu_msg_get_cc (msg)))
|
||||
g_print ("Cc: %s\n", field);
|
||||
|
||||
field = mu_msg_get_subject (msg);
|
||||
if (field)
|
||||
if ((field = mu_msg_get_subject (msg)))
|
||||
g_print ("Subject: %s\n", field);
|
||||
|
||||
date = mu_msg_get_date (msg);
|
||||
if (date)
|
||||
g_print ("Date: %s\n",
|
||||
mu_msg_str_date_s (date));
|
||||
if ((date = mu_msg_get_date (msg)))
|
||||
g_print ("Date: %s\n", mu_msg_str_date_s (date));
|
||||
|
||||
if (summary_len > 0) {
|
||||
field = mu_msg_get_summary (msg, summary_len);
|
||||
g_print ("Summary: %s\n", field ? field : "<none>");
|
||||
} else {
|
||||
|
||||
field = mu_msg_get_body_text (msg);
|
||||
if (field)
|
||||
g_print ("\n%s\n", field);
|
||||
else
|
||||
/* not really an error */
|
||||
g_debug ("No text body found for %s", path);
|
||||
}
|
||||
} else if ((mu_msg_get_body_text (msg)))
|
||||
g_print ("\n%s\n", field);
|
||||
else
|
||||
/* not really an error */
|
||||
g_debug ("No text body found for %s", path);
|
||||
|
||||
mu_msg_destroy (msg);
|
||||
|
||||
|
|
|
@ -117,12 +117,11 @@ save_part (GMimeObject *part, const char *filename,
|
|||
close (fd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* GMimeStream will close the fd */
|
||||
g_mime_stream_fs_set_owner (GMIME_STREAM_FS(stream), TRUE);
|
||||
|
||||
g_mime_stream_fs_set_owner (GMIME_STREAM_FS(stream),
|
||||
TRUE); /* GMimeStream will close the fd */
|
||||
|
||||
wrapper = g_mime_part_get_content_object (GMIME_PART(part));
|
||||
if (!wrapper) {
|
||||
if (!(wrapper = g_mime_part_get_content_object (GMIME_PART(part)))) {
|
||||
g_object_unref (G_OBJECT(stream));
|
||||
g_critical ("%s: failed to create wrapper", __FUNCTION__);
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue