#include <string.h>
-void
+static void
fill_list_of_caches (gpointer key, gpointer value, gpointer userdata)
{
GSList **send_queues = (GSList **) userdata;
return attachments_pixbuf;
case TNY_HEADER_FLAG_HIGH_PRIORITY:
if (G_UNLIKELY(!high_pixbuf))
- high_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_HIGH_PRIORITY);
+ high_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_HIGH);
return high_pixbuf;
case TNY_HEADER_FLAG_LOW_PRIORITY:
if (G_UNLIKELY(!low_pixbuf))
- low_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_LOW_PRIORITY);
+ low_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_LOW);
return low_pixbuf;
default:
if (G_UNLIKELY(!unread_pixbuf))
_modest_header_view_compact_header_cell_data (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer user_data)
{
- TnyHeaderFlags flags, prior_flags;
- gchar *address, *subject, *header;
- time_t date;
- ModestHeaderViewCompactHeaderMode header_mode;
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (column));
+ g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
+ g_return_if_fail (GTK_IS_TREE_MODEL (tree_model));
+
+ /* Note that GtkTreeModel is a GtkTreeModelFilter. */
+
+ /* printf ("DEBUG: %s: tree_model gtype=%s\n", __FUNCTION__, G_OBJECT_TYPE_NAME (tree_model)); */
+
+ TnyHeaderFlags flags = 0;
+ TnyHeaderFlags prior_flags = 0;
+ gchar *address = NULL;
+ gchar *subject = NULL;
+ gchar *header = NULL;
+ time_t date = 0;
+
GtkCellRenderer *recipient_cell, *date_or_status_cell, *subject_cell,
*attach_cell, *priority_cell,
- *recipient_box, *subject_box;
+ *recipient_box, *subject_box = NULL;
TnyHeader *msg_header = NULL;
gchar *display_date = NULL, *tmp_date = NULL;
recipient_cell = GTK_CELL_RENDERER (g_object_get_data (G_OBJECT (recipient_box), "recipient-renderer"));
date_or_status_cell = GTK_CELL_RENDERER (g_object_get_data (G_OBJECT (recipient_box), "date-renderer"));
- header_mode = GPOINTER_TO_INT (user_data);
+ ModestHeaderViewCompactHeaderMode header_mode = GPOINTER_TO_INT (user_data);
if (header_mode == MODEST_HEADER_VIEW_COMPACT_HEADER_MODE_IN)
gtk_tree_model_get (tree_model, iter,
else
g_object_set (G_OBJECT (priority_cell), "pixbuf",
NULL, NULL);
+
header = g_markup_printf_escaped ("%s", (subject && strlen (subject)) ? subject : _("mail_va_no_subject"));
g_free (subject);
+ subject = NULL;
g_object_set (G_OBJECT (subject_cell), "markup", header, NULL);
g_free (header);
+ header = NULL;
set_common_flags (subject_cell, flags);
- /* fixme: we hardcode the color to #666666; instead we should use SecundaryTextColour from the
+ /* fixme: we hardcode the color to #666666; instead we should use SecondaryTextColour from the
* theme (gtkrc file) */
header = g_markup_printf_escaped ("<span size='small' foreground='#666666'>%s</span>", modest_text_utils_get_display_address (address));
g_free (address);
+ address = NULL;
g_object_set (G_OBJECT (recipient_cell),
"markup", header,
NULL);
g_free (header);
+ header = NULL;
set_common_flags (recipient_cell, flags);
if (header_mode == MODEST_HEADER_VIEW_COMPACT_HEADER_MODE_OUTBOX) {
/* if (prior_flags == TNY_HEADER_FLAG_SUSPENDED_PRIORITY) */
/* status = MODEST_TNY_SEND_QUEUE_SUSPENDED; */
}
+
status_str = get_status_string (status);
display_date = g_strdup_printf("<span size='small' foreground='#666666'>%s</span>", status_str);
g_object_set (G_OBJECT (date_or_status_cell),
"markup", display_date,
NULL);
g_free (display_date);
+ display_date = NULL;
} else {
/* in some rare cases, mail might have no Date: field. it case,
* don't show the date, instead of bogus 1/1/1970
"markup", display_date,
NULL);
g_free (tmp_date);
+ tmp_date = NULL;
g_free (display_date);
+ display_date = NULL;
}
+
if (msg_header != NULL)
g_object_unref (msg_header);
+
set_common_flags (date_or_status_cell, flags);
}