From 78b66af8ce96ab41e476d3ebf36cd85fced6d781 Mon Sep 17 00:00:00 2001 From: 8 Date: Sun, 28 Oct 2001 05:10:56 +0000 Subject: Use path not protocol as the path part of the uri of the folder_created 2001-10-28 * providers/local/camel-local-folder.c (camel_local_folder_construct): Use path not protocol as the path part of the uri of the folder_created event. * providers/local/camel-maildir-store.c (scan_dir): If FAST is set, dont try and scan for unread counts. * providers/local/camel-local-store.c (create_folder): Implement, just return the folderinfo of the folder matched, not all of it. * camel-store.c (camel_store_rename_folder): Rename the camelfolders before emitting the folderchanged event (otherwise vstore fails to pick up change. * camel-store.c (camel_store_init): Always use a default dir_sep of '/'. * camel-store.h (struct _CamelStore): Added a dir_sep to the base store so rename and whatnot can work, temporary fix for mixed dir separator in folder name api's. * providers/imap/camel-map-store.c: (imap_connect_online): Also set the store's dir_sep here. (imap_connect_offline): " svn path=/trunk/; revision=14275 --- camel/camel-store.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'camel/camel-store.c') diff --git a/camel/camel-store.c b/camel/camel-store.c index c6ffdcdaae..c993c74fee 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -122,6 +122,8 @@ camel_store_init (void *o) /* set vtrash on by default */ store->flags = CAMEL_STORE_VTRASH; + + store->dir_sep = '/'; store->priv = g_malloc0 (sizeof (*store->priv)); #ifdef ENABLE_THREADS @@ -433,17 +435,6 @@ camel_store_rename_folder (CamelStore *store, const char *old_name, const char * guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; CamelRenameInfo reninfo; - /* Emit changed signal */ - if (store->flags & CAMEL_STORE_SUBSCRIPTIONS) - flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; - - reninfo.old_base = (char *)old_name; - reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->classfuncs)->get_folder_info(store, new_name, flags, ex); - if (info.new != NULL) { - camel_object_trigger_event(CAMEL_OBJECT(store), "folder_renamed", &reninfo); - ((CamelStoreClass *)((CamelObject *)store)->classfuncs)->free_folder_info(store, reninfo.new); - } - CAMEL_STORE_LOCK(store, cache_lock); for (i=0;ilen;i++) { char *new; @@ -464,6 +455,17 @@ camel_store_rename_folder (CamelStore *store, const char *old_name, const char * camel_object_unref((CamelObject *)folder); } CAMEL_STORE_UNLOCK(store, cache_lock); + + /* Emit changed signal */ + if (store->flags & CAMEL_STORE_SUBSCRIPTIONS) + flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED; + + reninfo.old_base = (char *)old_name; + reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->classfuncs)->get_folder_info(store, new_name, flags, ex); + if (info.new != NULL) { + camel_object_trigger_event(CAMEL_OBJECT(store), "folder_renamed", &reninfo); + ((CamelStoreClass *)((CamelObject *)store)->classfuncs)->free_folder_info(store, reninfo.new); + } } else { /* Failed, just unlock our folders for re-use */ for (i=0;ilen;i++) { -- cgit