Example #1
0
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);
}
Example #2
0
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);
}