From 405ef3bcf3cf661a017fd133a0771c3cb1b78b3a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 2 Aug 2002 22:36:11 +0000 Subject: Updated to use the new Follow-Up tags. Instead of storing a string 2002-08-02 Jeffrey Stedfast * mail-display.c (mail_display_render): Updated to use the new Follow-Up tags. Instead of storing a string containing the follow-up tag value, we now have to store the CamelMessageInfo. (mail_display_destroy): Unref the folder and the message-info. * folder-browser.c (followup_tag_complete): No longer needed. (on_right_clicked): Use the individual follow-up tags to decide whether or not to enable something. * message-list.c (ml_tree_value_at): Update to use the new Follow-Up tags. * mail-callbacks.c (flag_for_followup): Update to use the new MessageTagEditor API. (tag_editor_ok): Update this too. (flag_followup_completed): Updated this too. (flag_followup_clear): Set all the follow-up tag values to "". svn path=/trunk/; revision=17691 --- mail/message-list.c | 53 +++++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 36 deletions(-) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index ddfbe0b465..ab2e95a0b0 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -46,8 +46,6 @@ #include "mail-ops.h" #include "Mail.h" -#include "message-tag-followup.h" - #include "art/mail-new.xpm" #include "art/mail-read.xpm" #include "art/mail-replied.xpm" @@ -910,42 +908,25 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) const char *tag; tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - if (tag) + if (tag && *tag) return GINT_TO_POINTER (TRUE); else return GINT_TO_POINTER (FALSE); } case COL_FOLLOWUP_DUE_BY: { - struct _FollowUpTag *tag; - const char *tag_value; + const char *tag; time_t due_by; - tag_value = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - if (tag_value) { - tag = message_tag_followup_decode (tag_value); - due_by = tag->target_date; - g_free (tag); + tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by"); + if (tag && *tag) { + due_by = header_decode_date (tag, NULL); return GINT_TO_POINTER (due_by); } else { return GINT_TO_POINTER (0); } } - case COL_FOLLOWUP_FLAG: { - struct _FollowUpTag *tag; - const char *tag_value; - int flag_type; - - tag_value = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - if (tag_value) { - tag = message_tag_followup_decode (tag_value); - flag_type = tag ? tag->type : FOLLOWUP_FLAG_NONE; - g_free (tag); - - return (void *) message_tag_followup_i18n_name (flag_type); - } else { - return NULL; - } - } + case COL_FOLLOWUP_FLAG: + return (void *) camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); case COL_ATTACHMENT: return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_ATTACHMENTS) != 0); case COL_FROM: @@ -980,32 +961,32 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) return GINT_TO_POINTER (!(msg_info->flags & CAMEL_MESSAGE_SEEN)); } case COL_COLOUR: { - const char *colour, *followup, *label; + const char *colour, *due_by, *completed, *label; - /* Priority: colour tag; label tag; important flag; follow-up tag */ + /* Priority: colour tag; label tag; important flag; due-by tag */ colour = camel_tag_get ((CamelTag **) &msg_info->user_tags, "colour"); - followup = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); + due_by = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by"); + completed = camel_tag_get ((CamelTag **) &msg_info->user_tags, "completed-on"); label = camel_tag_get ((CamelTag **) &msg_info->user_tags, "label"); if (colour == NULL) { if (label != NULL) { - colour = mail_config_get_label_color_string (filter_label_index(label)); + colour = mail_config_get_label_color_string (filter_label_index (label)); } else if (msg_info->flags & CAMEL_MESSAGE_FLAGGED) { /* FIXME: extract from the xpm somehow. */ colour = "#A7453E"; - } else if (followup != NULL) { - struct _FollowUpTag *tag; + } else if ((due_by && *due_by) && !(completed && *completed)) { time_t now = time (NULL); + time_t target_date; - tag = message_tag_followup_decode (followup); - if (tag && now >= tag->target_date) { + target_date = header_decode_date (due_by, NULL); + if (now >= target_date) { /* FIXME: extract from the xpm somehow. */ colour = "#A7453E"; } - g_free (tag); } } - return (void *)colour; + return (void *) colour; } case COL_LOCATION: { CamelFolder *folder; -- cgit v1.2.3