aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
author9 <NotZed@Ximian.com>2001-10-29 13:06:28 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-29 13:06:28 +0800
commitfedf164cb97afe53eab3e3e4fcfb1765e89a61b5 (patch)
treeba5fe92df8f9a87e9d2f98e2c8f0a3b97af24410 /mail/folder-browser.c
parentfa6339027dff8a7c5040c4b03bcf523a6fd9aa02 (diff)
downloadgsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar.gz
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar.bz2
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar.lz
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar.xz
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.tar.zst
gsoc2013-evolution-fedf164cb97afe53eab3e3e4fcfb1765e89a61b5.zip
Copy the folder's full_name before trying to use it to rename.
2001-10-29 <NotZed@Ximian.com> * mail-vfolder.c (rule_changed): Copy the folder's full_name before trying to use it to rename. (vfolder_edit_rule): Set 'orig' to be a reference of the original rule. (edit_rule_clicked): Dont lookup orig by name, copy it over instead. * folder-browser.c (got_folder): oops, emit signal before unreffing object, incase we got killded during getting folder. (got_folder): Reset get_id. (folder_browser_new): Set get_id of the get_folder task. (folder_browser_init): Init get_id. (folder_browser_destroy): IF we have outstanding 'get folder' op, cancel it. svn path=/trunk/; revision=14323
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index a210a98280..8e79e6467e 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -207,6 +207,11 @@ folder_browser_destroy (GtkObject *object)
/* wait for all outstanding async events against us */
mail_async_event_destroy (folder_browser->async_event);
+
+ if (folder_browser->get_id != -1) {
+ mail_msg_cancel(folder_browser->get_id);
+ folder_browser->get_id = -1;
+ }
if (folder_browser->folder) {
camel_object_unhook_event (CAMEL_OBJECT (folder_browser->folder), "folder_changed",
@@ -826,8 +831,10 @@ static void folder_changed(CamelObject *o, void *event_data, void *data)
static void
got_folder(char *uri, CamelFolder *folder, void *data)
{
- FolderBrowser *fb = data;
-
+ FolderBrowser *fb = data;
+
+ fb->get_id = -1;
+
d(printf ("got folder '%s' = %p, previous folder was %p\n", uri, folder, fb->folder));
if (fb->message_list == NULL)
@@ -855,10 +862,9 @@ got_folder(char *uri, CamelFolder *folder, void *data)
if (fb->uicomp)
folder_browser_ui_set_selection_state (fb, FB_SELSTATE_NONE);
- done:
- gtk_object_unref (GTK_OBJECT (fb));
-
+ done:
gtk_signal_emit (GTK_OBJECT (fb), folder_browser_signals [FOLDER_LOADED], fb->uri);
+ gtk_object_unref (GTK_OBJECT (fb));
}
void
@@ -1932,6 +1938,7 @@ folder_browser_init (GtkObject *object)
FolderBrowser *fb = (FolderBrowser *)object;
fb->async_event = mail_async_event_new();
+ fb->get_id = -1;
}
static void
@@ -2035,7 +2042,7 @@ folder_browser_new (const GNOME_Evolution_Shell shell, const char *uri)
folder_browser->uri = g_strdup (uri);
gtk_object_ref (GTK_OBJECT (folder_browser));
- mail_get_folder (folder_browser->uri, 0, got_folder, folder_browser, mail_thread_new);
+ folder_browser->get_id = mail_get_folder (folder_browser->uri, 0, got_folder, folder_browser, mail_thread_new);
return GTK_WIDGET (folder_browser);
}