diff options
author | 1 <NotZed@Ximian.com> | 2001-10-22 04:28:58 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-10-22 04:28:58 +0800 |
commit | a02822a94ed38a72f24bc3ea61fdc42cd2ffcb62 (patch) | |
tree | 4bd56a134ef4c5a34fa15ff535fe45a38c3566de /mail/folder-browser.c | |
parent | c435267723233da063f2ffdbc472a687cbc16658 (diff) | |
download | gsoc2013-evolution-a02822a94ed38a72f24bc3ea61fdc42cd2ffcb62.tar.gz gsoc2013-evolution-a02822a94ed38a72f24bc3ea61fdc42cd2ffcb62.tar.zst gsoc2013-evolution-a02822a94ed38a72f24bc3ea61fdc42cd2ffcb62.zip |
Clear variables once done, for debugging. (mail_vfolder_add_uri,
2001-10-21 <NotZed@Ximian.com>
* mail-vfolder.c (mail_vfolder_shutdown): Clear variables once
done, for debugging.
(mail_vfolder_add_uri, mail_vfolder_delete_uri): Dont do anything
if we're shutdown (context == NULL).
* component-factory.c (idle_quit): Move mail_vfolder_shutdown
here, it should be one of the last things shutdown.
* mail-format.c (handle_text_plain): Dont use (if (!p++), and then
check p!= later, since its now 1, oops. Fixes #13106, thought it
was a start of uuencoded stuff!
* folder-browser.c (on_right_click): Escape _'s before adding them
to menu from mailing list name, also remove some dead code that
someone forgot to remove when refactoring. #11307.
(folder_browser_is_drafts): Use the store's uri_cmp function to
compare to the drafts uri's.
(folder_browser_is_sent): Same. Slight cleanup for #11351.
svn path=/trunk/; revision=13856
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r-- | mail/folder-browser.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 8e9b7807f7..f5deb31499 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -893,17 +893,16 @@ folder_browser_is_drafts (FolderBrowser *fb) g_return_val_if_fail (IS_FOLDER_BROWSER (fb), FALSE); - if (fb->uri == NULL) + if (fb->uri == NULL || fb->folder == NULL) return FALSE; if (fb->folder == drafts_folder) return TRUE; - + accounts = mail_config_get_accounts (); while (accounts) { account = accounts->data; - if (account->drafts_folder_uri && - !strcmp (account->drafts_folder_uri, fb->uri)) + if (account->drafts_folder_uri && camel_store_uri_cmp(fb->folder->parent_store, account->drafts_folder_uri, fb->uri)) return TRUE; accounts = accounts->next; } @@ -926,7 +925,7 @@ folder_browser_is_sent (FolderBrowser *fb) g_return_val_if_fail (IS_FOLDER_BROWSER (fb), FALSE); - if (fb->uri == NULL) + if (fb->uri == NULL || fb->folder == NULL) return FALSE; if (fb->folder == sent_folder) @@ -935,8 +934,7 @@ folder_browser_is_sent (FolderBrowser *fb) accounts = mail_config_get_accounts (); while (accounts) { account = accounts->data; - if (account->sent_folder_uri && - !strcmp (account->sent_folder_uri, fb->uri)) + if (account->sent_folder_uri && camel_store_uri_cmp(fb->folder->parent_store, account->sent_folder_uri, fb->uri)) return TRUE; accounts = accounts->next; } @@ -1493,8 +1491,7 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event int enable_mask = 0; int hide_mask = 0; int i; - char *mailing_list_name = NULL; - char *subject_match = NULL, *from_match = NULL; + char *mlist = NULL; GtkMenu *menu; if (fb->folder != sent_folder) { @@ -1504,22 +1501,23 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event if (fb->mail_display->current_message == NULL) { enable_mask |= SELECTION_SET; - mailing_list_name = NULL; } else { - /* FIXME: we are leaking subject_match and from_match...what do we use them for anyway??? */ - const char *subject, *real, *addr; - const CamelInternetAddress *from; - - mailing_list_name = header_raw_check_mailing_list( - &((CamelMimePart *)fb->mail_display->current_message)->headers); - - subject = camel_mime_message_get_subject (fb->mail_display->current_message); - if (subject && (subject = strip_re (subject)) && subject[0]) - subject_match = g_strdup (subject); - - from = camel_mime_message_get_from (fb->mail_display->current_message); - if (from && camel_internet_address_get (from, 0, &real, &addr) && addr && addr[0]) - from_match = g_strdup (addr); + char *mname, *p, c, *o; + + mname = header_raw_check_mailing_list(&((CamelMimePart *)fb->mail_display->current_message)->headers); + /* Escape the mailing list name before showing it */ + if (mname) { + mlist = alloca(strlen(mname)+2); + p = mname; + o = mlist; + while ((c = *p++)) { + if (c=='_') + *o++='_'; + *o++ = c; + } + *o = 0; + g_free(mname); + } } /* get a list of uids */ @@ -1606,14 +1604,13 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event g_ptr_array_free (uids, TRUE); /* generate the "Filter on Mailing List menu item name */ - if (mailing_list_name == NULL) { + if (mlist == NULL) { enable_mask |= IS_MAILING_LIST; filter_menu[MLIST_FILTER].name = g_strdup (_("Filter on Mailing List")); filter_menu[MLIST_VFOLDER].name = g_strdup (_("VFolder on Mailing List")); } else { - filter_menu[MLIST_FILTER].name = g_strdup_printf (_("Filter on Mailing List (%s)"), mailing_list_name); - filter_menu[MLIST_VFOLDER].name = g_strdup_printf (_("VFolder on Mailing List (%s)"), mailing_list_name); - g_free(mailing_list_name); + filter_menu[MLIST_FILTER].name = g_strdup_printf (_("Filter on Mailing List (%s)"), mlist); + filter_menu[MLIST_VFOLDER].name = g_strdup_printf (_("VFolder on Mailing List (%s)"), mlist); } menu = e_popup_menu_create (context_menu, enable_mask, hide_mask, fb); |