static void add_row (GtkListStore * store, MuMsg *msg) { GtkTreeIter treeiter; const gchar *datestr, *flagstr; gchar *from, *to; time_t timeval; timeval = mu_msg_get_date (msg); datestr = timeval == 0 ? "-" : mu_date_display_s (timeval); from = empty_or_display_contact (mu_msg_get_from (msg)); to = empty_or_display_contact (mu_msg_get_to (msg)); flagstr = mu_flags_to_str_s (mu_msg_get_flags (msg), MU_FLAG_TYPE_ANY); gtk_list_store_append (store, &treeiter); gtk_list_store_set (store, &treeiter, MUG_COL_DATESTR, datestr, MUG_COL_MAILDIR, mu_msg_get_maildir (msg), MUG_COL_FLAGSSTR, flagstr, MUG_COL_FROM, from, MUG_COL_TO, to, MUG_COL_SUBJECT, mu_msg_get_subject (msg), MUG_COL_PATH, mu_msg_get_path (msg), MUG_COL_PRIO, mu_msg_get_prio (msg), MUG_COL_FLAGS, mu_msg_get_flags (msg), MUG_COL_TIME, timeval, -1); g_free (from); g_free (to); }
static void add_row (GtkTreeStore * store, MuMsg *msg, GtkTreeIter *treeiter) { const gchar *datestr, *flagstr; gchar *from, *to; time_t timeval; timeval = mu_msg_get_date (msg); datestr = timeval == 0 ? "-" : mu_date_display_s (timeval); from = empty_or_display_contact (mu_msg_get_from (msg)); to = empty_or_display_contact (mu_msg_get_to (msg)); flagstr = mu_flags_to_str_s (mu_msg_get_flags (msg), MU_FLAG_TYPE_ANY); /* if (0) { */ /* GtkTreeIter myiter; */ /* if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(store), */ /* &myiter, path)) */ /* g_warning ("%s: cannot get iter for %s", * __FUNCTION__, path); */ /* } */ gtk_tree_store_set (store, treeiter, MUG_COL_DATESTR, datestr, MUG_COL_MAILDIR, mu_msg_get_maildir (msg), MUG_COL_FLAGSSTR, flagstr, MUG_COL_FROM, from, MUG_COL_TO, to, MUG_COL_SUBJECT, mu_msg_get_subject (msg), MUG_COL_PATH, mu_msg_get_path (msg), MUG_COL_PRIO, mu_msg_get_prio (msg), MUG_COL_FLAGS, mu_msg_get_flags (msg), MUG_COL_TIME, timeval, -1); g_free (from); g_free (to); }
static void json_add_flags(JsonBuilder *builder, MuMsg *msg) { MuFlags flags; const char *flags_str; flags = mu_msg_get_flags (msg); if (flags) { flags_str = mu_flags_to_str_s (flags, (MuFlagType)MU_FLAG_TYPE_ANY); if (flags_str) { json_builder_set_member_name (builder, "flags"); json_builder_add_string_value (builder, flags_str); } } }
static gboolean output_xml (MuMsg *msg, MuMsgIter *iter, MuConfig *opts, GError **err) { g_print ("\t<message>\n"); print_attr_xml ("from", mu_msg_get_from (msg)); print_attr_xml ("to", mu_msg_get_to (msg)); print_attr_xml ("cc", mu_msg_get_cc (msg)); print_attr_xml ("subject", mu_msg_get_subject (msg)); g_print ("\t\t<date>%u</date>\n", (unsigned)mu_msg_get_date (msg)); g_print ("\t\t<size>%u</size>\n", (unsigned)mu_msg_get_size (msg)); print_attr_xml ("msgid", mu_msg_get_msgid (msg)); print_attr_xml ("path", mu_msg_get_path (msg)); print_attr_xml ("maildir", mu_msg_get_maildir (msg)); print_attr_xml ("flags", mu_flags_to_str_s (mu_msg_get_flags (msg), (MuFlagType)MU_FLAG_TYPE_ANY)); g_print ("\t</message>\n"); return TRUE; }
const char* mu_str_flags_s (MuFlags flags) { return mu_flags_to_str_s (flags, MU_FLAG_TYPE_ANY); }