aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
author5 <NotZed@Ximian.com>2001-10-06 05:49:17 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-06 05:49:17 +0800
commit5ad20324785610c9e45a5cee5a885e3a00bf78e9 (patch)
tree0be6c1a402a32defeb12fa218d2c897a9ef90f03 /camel
parenta2d9676982f3bab99567be9516d6b70d9235524a (diff)
downloadgsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.tar.gz
gsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.tar.zst
gsoc2013-evolution-5ad20324785610c9e45a5cee5a885e3a00bf78e9.zip
Use a folder_subscribed event rather than a folder_created one.
2001-10-05 <NotZed@Ximian.com> * providers/imap/camel-imap-store.c (subscribe_folder): Use a folder_subscribed event rather than a folder_created one. (unsubscribe_folder): Similarly for unsubscribed/deleted. (create_folder): Emit a folder_created event on the folders we added. Not sure hsould probably check which ones are new and which ones are just existing ones? (delete_folder): Emit a folder_deletd event when we've deleted the folder. Part of fix for #11831. * camel-store.c (camel_store_class_init): Added folder_subscribed/unsubscribed events. svn path=/trunk/; revision=13471
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog14
-rw-r--r--camel/camel-store.c11
-rw-r--r--camel/providers/imap/camel-imap-store.c24
3 files changed, 41 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index ab80c0cf0c..d6cf01ed49 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,17 @@
+2001-10-05 <NotZed@Ximian.com>
+
+ * providers/imap/camel-imap-store.c (subscribe_folder): Use a
+ folder_subscribed event rather than a folder_created one.
+ (unsubscribe_folder): Similarly for unsubscribed/deleted.
+ (create_folder): Emit a folder_created event on the folders we
+ added. Not sure hsould probably check which ones are new and
+ which ones are just existing ones?
+ (delete_folder): Emit a folder_deletd event when we've deleted the
+ folder. Part of fix for #11831.
+
+ * camel-store.c (camel_store_class_init): Added
+ folder_subscribed/unsubscribed events.
+
2001-10-05 Jeffrey Stedfast <fejj@ximian.com>
* camel-service.c (camel_service_finalize): Turn off warnings.
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 779c900edd..4bc5de3f83 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -77,8 +77,7 @@ static void construct (CamelService *service, CamelSession *session,
static void
camel_store_class_init (CamelStoreClass *camel_store_class)
{
- CamelObjectClass *camel_object_class =
- CAMEL_OBJECT_CLASS (camel_store_class);
+ CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_store_class);
CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_store_class);
parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
@@ -103,10 +102,10 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
/* virtual method overload */
camel_service_class->construct = construct;
- camel_object_class_declare_event (camel_object_class,
- "folder_created", NULL);
- camel_object_class_declare_event (camel_object_class,
- "folder_deleted", NULL);
+ camel_object_class_declare_event(camel_object_class, "folder_created", NULL);
+ camel_object_class_declare_event(camel_object_class, "folder_deleted", NULL);
+ camel_object_class_declare_event(camel_object_class, "folder_subscribed", NULL);
+ camel_object_class_declare_event(camel_object_class, "folder_unsubscribed", NULL);
}
static void
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 1ab13d9a47..efe60cfba7 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1043,6 +1043,8 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
char *summary_file;
char *journal_file;
char *folder_dir;
+ CamelFolderInfo *fi;
+ char *name;
folder_dir = e_path_to_physical (imap_store->storage_path, folder_name);
if (access (folder_dir, F_OK) != 0) {
@@ -1074,6 +1076,21 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
rmdir (folder_dir);
g_free (folder_dir);
+
+ name = strrchr (folder_name, imap_store->dir_sep);
+ if (name)
+ name++;
+ else
+ name = folder_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_folder_info_build_path (fi, imap_store->dir_sep);
+ camel_object_trigger_event (CAMEL_OBJECT (store), "folder_deleted", fi);
+ camel_folder_info_free (fi);
}
}
@@ -1202,6 +1219,9 @@ create_folder (CamelStore *store, const char *parent_name,
parent = fi;
}
+ camel_folder_info_build_path(root, imap_store->dir_sep);
+ camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
+
g_free (pathnames);
g_ptr_array_free (folders, TRUE);
@@ -1606,7 +1626,7 @@ subscribe_folder (CamelStore *store, const char *folder_name,
camel_url_free (url);
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", fi);
+ camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi);
camel_folder_info_free (fi);
}
@@ -1647,7 +1667,7 @@ unsubscribe_folder (CamelStore *store, const char *folder_name,
fi->unread_message_count = -1;
camel_folder_info_build_path (fi, imap_store->dir_sep);
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_deleted", fi);
+ camel_object_trigger_event (CAMEL_OBJECT (store), "folder_unsubscribed", fi);
camel_folder_info_free (fi);
}