+static GdkPixbuf*
+get_pixbuf_for_compact_flag (TnyHeaderFlags flags)
+{
+ /* optimization */
+ static GdkPixbuf *high_attachments_pixbuf = NULL;
+ static GdkPixbuf *normal_attachments_pixbuf = NULL;
+ static GdkPixbuf *low_attachments_pixbuf = NULL;
+ static GdkPixbuf *high_pixbuf = NULL;
+ static GdkPixbuf *low_pixbuf = NULL;
+
+ if (flags & TNY_HEADER_FLAG_ATTACHMENTS) {
+ if (flags & TNY_HEADER_FLAG_HIGH_PRIORITY) {
+ if (G_UNLIKELY(!high_attachments_pixbuf))
+ high_attachments_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_ATTACH_HIGH_PRIORITY);
+ return high_attachments_pixbuf;
+ }
+ else if (flags & TNY_HEADER_FLAG_LOW_PRIORITY) {
+ if (G_UNLIKELY(!low_attachments_pixbuf))
+ low_attachments_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_ATTACH_LOW_PRIORITY);
+ return low_attachments_pixbuf;
+ }
+ else {
+ if (G_UNLIKELY(!normal_attachments_pixbuf))
+ normal_attachments_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_ATTACH_NORM_PRIORITY);
+ return normal_attachments_pixbuf;
+ }
+ }
+ else if (flags & TNY_HEADER_FLAG_HIGH_PRIORITY) {
+ if (G_UNLIKELY(!high_pixbuf))
+ high_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_HIGH_PRIORITY);
+ return high_pixbuf;
+ }
+ else if (flags & TNY_HEADER_FLAG_LOW_PRIORITY) {
+ if (G_UNLIKELY(!low_pixbuf))
+ low_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_LOW_PRIORITY);
+ return low_pixbuf;
+ }
+
+
+ return NULL;
+}
+
+static void
+set_common_flags (GtkCellRenderer *renderer, TnyHeaderFlags flags)
+{
+ g_object_set (G_OBJECT(renderer),
+ "weight", (flags & TNY_HEADER_FLAG_SEEN) ? PANGO_WEIGHT_NORMAL: PANGO_WEIGHT_ULTRABOLD,
+ "strikethrough", (flags & TNY_HEADER_FLAG_DELETED) ? TRUE:FALSE,
+ NULL);
+}
+