Patch: disable IDLE in imap folders on uncaching TnyCamelFolder



	Hi,

	This patch stops IDLE when we uncache the TnyCamelFolder. This is
needed to avoid a problem with a reference loop we had with IDLE (we
didn't stop because we had a reference, and the reference was maintained
by IDLE).

	This should fix the problems browsing folders, leaving them, and have
IDLE working after this. This could cause other imap commands to be sent
(then, bad command as we can only send DONE command).

Changelog entry:
* libtinymail-camel/camel-lite/tny-camel-folder.c: disable push email
  on uncaching (to avoid keeping current folder active in store when
  we're not reading it anymore).


-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index c994359..f3daf09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-27  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymail-camel/camel-lite/tny-camel-folder.c: disable push email
+	on uncaching (to avoid keeping current folder active in store when
+	we're not reading it anymore).
+
 2009-02-16  Jose Dapena Paz  <jdapena igalia com>
 
 	* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c:
diff --git a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
index d54b69e..ec38212 100644
--- a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
+++ b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
@@ -252,7 +252,7 @@ let_idle_die (CamelImapStore *store, gboolean connect_buz)
 			CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 		}
 		g_free (store->idle_prefix);
-		store->idle_prefix=NULL;
+		store->idle_prefix = NULL;
 	}
 
 	g_static_rec_mutex_unlock (store->idle_prefix_lock);
diff --git a/libtinymail-camel/tny-camel-folder.c b/libtinymail-camel/tny-camel-folder.c
index 714a6f0..1dcc062 100644
--- a/libtinymail-camel/tny-camel-folder.c
+++ b/libtinymail-camel/tny-camel-folder.c
@@ -463,6 +463,8 @@ unload_folder_no_lock (TnyCamelFolderPriv *priv, gboolean destroy)
 		if (priv->folder_changed_id != 0)
 			camel_object_remove_event (priv->folder, priv->folder_changed_id);
 
+		camel_folder_set_push_email (priv->folder, FALSE);
+
 		/* printf ("UNLOAD (%s): %d\n",
 				priv->folder_name?priv->folder_name:"NUL",
 				(((CamelObject*)priv->folder)->ref_count));  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]