Patch: refresh parameter in get_folders forces a retrieve of folder structure



	Hi,

	This patch just makes get_folders with refresh parameter enabled fetch
again the folder structure instead of using the cached one. This way we
can show also newly created folders.

	This should make "refresh" operations slower (they'll always get again
the folder structure for remote accounts). It's good for most cases, as
we want to know the changes not only in the number of messages in
folders, but also in the folders available. Just, remember to review
your calls to get_folders, with refresh parameter. 

	If you have any, test the patch and tell us if you find problems.

	In special, Rob, Mathew, please review this patch as you've introduced
the refresh api, so I guess you're users of this API :).

-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index 0b8da63..89a0374 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-11  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymail-camel/tny-camel-store-account.c: now
+	get_folders "refresh" parameter forces to fetch again
+	the list of folders. This way we can acknowledge when
+	there are new folders available on server.
+
 2009-03-06  Sergio Villar Senin  <svillar igalia com>
 
 	* libtinymail-camel/tny-session-camel.c
diff --git a/libtinymail-camel/tny-camel-store-account.c b/libtinymail-camel/tny-camel-store-account.c
index 753cefd..79ab898 100644
--- a/libtinymail-camel/tny-camel-store-account.c
+++ b/libtinymail-camel/tny-camel-store-account.c
@@ -1428,6 +1428,10 @@ tny_camel_store_account_get_folders_default (TnyFolderStore *self, TnyList *list
 
 	iter = priv->iter;
 
+	if (refresh && CAMEL_IS_DISCO_STORE (store)) {
+		priv->cant_reuse_iter = TRUE;
+	}
+
 	if (!iter || priv->cant_reuse_iter) {
 		if (!refresh && CAMEL_IS_DISCO_STORE(store)) {
 			iter = CAMEL_DISCO_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->get_folder_info_offline(store,  "", flags, &ex);


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