aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-16 03:20:38 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-16 03:20:38 +0800
commitf89ca302d1bc8cdd0a988121523928b80366441a (patch)
tree4779cde1691418bccaa93608c7493c6558cd30f6 /camel/providers/imap
parentcb66ad3fe4a2297ea211adfe012dbdf3f875090b (diff)
downloadgsoc2013-evolution-f89ca302d1bc8cdd0a988121523928b80366441a.tar.gz
gsoc2013-evolution-f89ca302d1bc8cdd0a988121523928b80366441a.tar.zst
gsoc2013-evolution-f89ca302d1bc8cdd0a988121523928b80366441a.zip
Emit the folder_created signal here.
2001-02-15 Jeffrey Stedfast <fejj@ximian.com> * providers/vee/camel-vee-folder.c (camel_vee_folder_new): Emit the folder_created signal here. * providers/local/camel-local-folder.c (camel_local_folder_construct): Emit the folder_created signal. * providers/local/camel-local-store.c (delete_folder): On error, free the 'name' string so we don't leak. Also emit the folder_deleted signal. * providers/imap/camel-imap-store.c (subscribe_folder): Emit the folder_created signal. (unsubscribe_folder): Emit the folder_deleted signal. * camel-store.c (camel_store_class_init): Added folder_created and folder_deleted signal defs. svn path=/trunk/; revision=8246
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 1355cedb76..960d6275ca 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -715,6 +715,7 @@ create_folder (CamelStore *store, const char *parent_name,
fi = get_folder_info (store, full_name, FALSE, FALSE, FALSE, ex);
g_free (full_name);
+
return fi;
}
@@ -966,7 +967,7 @@ subscribe_folder (CamelStore *store, const char *folder_name,
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelImapResponse *response;
-
+
if (!camel_remote_store_connected (CAMEL_REMOTE_STORE (store), ex))
return;
@@ -975,9 +976,27 @@ subscribe_folder (CamelStore *store, const char *folder_name,
"SUBSCRIBE %S", folder_name);
CAMEL_IMAP_STORE_UNLOCK(imap_store, command_lock);
if (response) {
+ CamelFolderInfo *fi;
+ char *name;
+
g_hash_table_insert (imap_store->subscribed_folders,
g_strdup (folder_name),
GUINT_TO_POINTER (1));
+
+ name = strrchr (folder_name, imap_store->dir_sep);
+ if (name)
+ name++;
+
+ fi = g_new0 (CamelFolderInfo, 1);
+ fi->full_name = g_strdup (folder_name);
+ fi->name = g_strdup (name);
+ fi->url = g_strdup_printf ("%s%s", imap_store->base_url, folder_name);
+ fi->unread_message_count = -1;
+
+ camel_object_trigger_event (CAMEL_OBJECT (store),
+ "folder_created", fi);
+
+ camel_folder_info_free (fi);
}
camel_imap_response_free (response);
}
@@ -998,11 +1017,29 @@ unsubscribe_folder (CamelStore *store, const char *folder_name,
"UNSUBSCRIBE %S", folder_name);
CAMEL_IMAP_STORE_UNLOCK(imap_store, command_lock);
if (response) {
+ CamelFolderInfo *fi;
+ char *name;
+
g_hash_table_lookup_extended (imap_store->subscribed_folders,
folder_name, &key, &value);
g_hash_table_remove (imap_store->subscribed_folders,
folder_name);
g_free (key);
+
+ name = strrchr (folder_name, imap_store->dir_sep);
+ if (name)
+ name++;
+
+ fi = g_new0 (CamelFolderInfo, 1);
+ fi->full_name = g_strdup (folder_name);
+ fi->name = g_strdup (name);
+ fi->url = g_strdup_printf ("%s%s", imap_store->base_url, folder_name);
+ fi->unread_message_count = -1;
+
+ camel_object_trigger_event (CAMEL_OBJECT (store),
+ "folder_deleted", fi);
+
+ camel_folder_info_free (fi);
}
camel_imap_response_free (response);
}