aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-vtrash.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-02-23 07:25:40 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-02-23 07:25:40 +0800
commit0af3e545203107534c7dac6dae0c8f7a009a7fe3 (patch)
tree9caa87a5a4a57f221b99d30ab4321e7d644d1d9e /mail/mail-vtrash.c
parent7cf1665ab87b3791549a2530687638da9a0d1135 (diff)
downloadgsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar.gz
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar.bz2
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar.lz
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar.xz
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.tar.zst
gsoc2013-evolution-0af3e545203107534c7dac6dae0c8f7a009a7fe3.zip
Only allow downloading if the source is enabled at this time.
2001-02-23 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (build_dialogue): Only allow downloading if the source is enabled at this time. (mail_autoreceive_setup): Check for enabled sources before setting up autodownload. * mail-vtrash.c (get_trash_free): Free store if we have it. (get_trash_got): Move vtrash add into here, so we execute in the right thread. svn path=/trunk/; revision=8354
Diffstat (limited to 'mail/mail-vtrash.c')
-rw-r--r--mail/mail-vtrash.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mail/mail-vtrash.c b/mail/mail-vtrash.c
index 207e72ef06..b83a7d7c32 100644
--- a/mail/mail-vtrash.c
+++ b/mail/mail-vtrash.c
@@ -120,7 +120,8 @@ vtrash_add (CamelStore *store, CamelFolder *folder, const char *store_uri, const
struct _get_trash_msg {
struct _mail_msg msg;
-
+
+ CamelStore *store;
char *store_uri;
CamelFolder *folder;
void (*done) (char *store_uri, CamelFolder *folder, void *data);
@@ -214,8 +215,8 @@ get_trash_get (struct _mail_msg *mm)
urls = g_ptr_array_new ();
/* we don't want to connect */
- store = (CamelStore *) camel_session_get_service (session, m->store_uri,
- CAMEL_PROVIDER_STORE, &mm->ex);
+ m->store = store = (CamelStore *) camel_session_get_service (session, m->store_uri,
+ CAMEL_PROVIDER_STORE, &mm->ex);
if (store == NULL) {
g_warning ("Couldn't get service %s: %s\n", m->store_uri,
camel_exception_get_description (&mm->ex));
@@ -239,7 +240,6 @@ get_trash_get (struct _mail_msg *mm)
camel_store_free_folder_info (store, info);
m->folder = create_trash_vfolder (_("vTrash"), urls, &mm->ex);
- vtrash_add (store, m->folder, m->store_uri, _("vTrash"));
}
}
@@ -251,6 +251,9 @@ static void
get_trash_got (struct _mail_msg *mm)
{
struct _get_trash_msg *m = (struct _get_trash_msg *)mm;
+
+ if (m->store)
+ vtrash_add (m->store, m->folder, m->store_uri, _("vTrash"));
if (m->done)
m->done (m->store_uri, m->folder, m->data);
@@ -260,7 +263,10 @@ static void
get_trash_free (struct _mail_msg *mm)
{
struct _get_trash_msg *m = (struct _get_trash_msg *)mm;
-
+
+ if (m->store)
+ camel_object_unref (CAMEL_OBJECT (m->store));
+
g_free (m->store_uri);
if (m->folder)
camel_object_unref (CAMEL_OBJECT (m->folder));