aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap4/camel-imap4-store.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-11-02 02:54:46 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-11-02 02:54:46 +0800
commit609e3620b733b5a4341d934e4825cab5d5d535bc (patch)
tree6ba6f37a2d142913849c936f33234da88db0ee56 /camel/providers/imap4/camel-imap4-store.c
parent69d4437179684dad21812702ead2b1e39d266cb4 (diff)
downloadgsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar.gz
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar.bz2
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar.lz
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar.xz
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.tar.zst
gsoc2013-evolution-609e3620b733b5a4341d934e4825cab5d5d535bc.zip
Cache the folder-info on the summary if successful. (imap4_delete_folder):
2004-11-01 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-store.c (imap4_create_folder): Cache the folder-info on the summary if successful. (imap4_delete_folder): Un-cache the folder-info from the summary. * providers/imap4/camel-imap4-store-summary.c (load_namespaces): Cleaned up a bit. (save_namespaces): Same. (camel_imap4_store_summary_unnote_info): New function. (camel_imap4_store_summary_get_folder_info): Fixed the logic a bit. svn path=/trunk/; revision=27782
Diffstat (limited to 'camel/providers/imap4/camel-imap4-store.c')
-rw-r--r--camel/providers/imap4/camel-imap4-store.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index 395804849c..ba86ac7dee 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -793,6 +793,8 @@ imap4_create_folder (CamelStore *store, const char *parent_name, const char *fol
fi->unread = -1;
fi->total = -1;
+ camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
+
camel_object_trigger_event (store, "folder_created", fi);
break;
case CAMEL_IMAP4_RESULT_NO:
@@ -893,6 +895,8 @@ imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException
fi->unread = -1;
fi->total = -1;
+ camel_imap4_store_summary_unnote_info (((CamelIMAP4Store *) store)->summary, fi);
+
camel_object_trigger_event (store, "folder_deleted", fi);
camel_folder_info_free (fi);
@@ -959,6 +963,7 @@ imap4_rename_folder (CamelStore *store, const char *old_name, const char *new_na
switch (ic->result) {
case CAMEL_IMAP4_RESULT_OK:
/* FIXME: need to update state on the renamed folder object */
+ /* FIXME: need to update cached summary info too */
break;
case CAMEL_IMAP4_RESULT_NO:
/* FIXME: would be good to save the NO reason into the err message */
@@ -1154,10 +1159,16 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
char wildcard;
int id, i;
+ if (top == NULL)
+ top = "";
+
CAMEL_SERVICE_LOCK (store, connect_lock);
if (!camel_session_is_online (session) || engine->state == CAMEL_IMAP4_ENGINE_DISCONNECTED) {
+ fprintf (stderr, "****************************************************\n");
+ fprintf (stderr, "*** Getting folder info in disconnected state... ***\n");
fi = camel_imap4_store_summary_get_folder_info (((CamelIMAP4Store *) store)->summary, top, flags);
+ fprintf (stderr, "****************************************************\n");
if (fi == NULL && camel_session_is_online (session)) {
/* folder info hasn't yet been cached and the store hasn't been
* connected yet, but the network is available so we can connect
@@ -1180,9 +1191,6 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
else
cmd = "LIST";
- if (top == NULL)
- top = "";
-
wildcard = (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) ? '*' : '%';
pattern = imap4_folder_utf7_name (store, top, wildcard);
array = g_ptr_array_new ();