From 36b0a7ea93d6a5b73c8f873a1ec9c11088115c7b Mon Sep 17 00:00:00 2001 From: Javier Fernandez Garcia-Boente Date: Fri, 20 Apr 2007 17:17:36 +0000 Subject: [PATCH] * Change priority managment logic, using HIGH flags as priority mask, and then compare it with = operator. pmo-trunk-r1617 --- src/widgets/modest-header-view-render.c | 38 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/widgets/modest-header-view-render.c b/src/widgets/modest-header-view-render.c index b3a83f7..c0177da 100644 --- a/src/widgets/modest-header-view-render.c +++ b/src/widgets/modest-header-view-render.c @@ -141,35 +141,39 @@ get_pixbuf_for_compact_flag (TnyHeaderFlags flags) 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) { + TnyHeaderFlags prior; + + prior = flags & TNY_HEADER_FLAG_HIGH_PRIORITY; + switch (prior) { + case TNY_HEADER_FLAG_HIGH_PRIORITY: + if (flags & TNY_HEADER_FLAG_ATTACHMENTS) { 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 (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) { + break; + case TNY_HEADER_FLAG_LOW_PRIORITY: + if (flags & TNY_HEADER_FLAG_ATTACHMENTS) { 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(!low_pixbuf)) + low_pixbuf = modest_platform_get_icon (MODEST_HEADER_ICON_LOW_PRIORITY); + return low_pixbuf; } - else { + break; + default: + if (flags & TNY_HEADER_FLAG_ATTACHMENTS) { 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; } -- 1.7.9.5