Re: Patch: fast folders list store operation



El mié, 07-10-2009 a las 11:47 +0200, José Dapena Paz escribió:
> 	Hi,
> 
> 	This patch improves the responsiveness of folder list store, avoiding
> queuing refresh and get folders operations caused by the list store.
> 
> 	This improves a lot the user perceived speed in modest, as it'll avoid
> waits on closing and opening again the folders view.
> 

	I'm attaching a patch that fixes some corner cases of the previous
patch. This patch should be applied on top of the previous one.

Changelog entries:

	* libtinymail-camel/tny-camel-imap-store-account.c,
	libtinymail-camel/tny-camel-store-account.c: force folders refresh
	in refresh traversal (at least one time).

	* libtinymailui-gtk/tny-gtk-folder-list-store.c: register folder
	store observer for every instance.


-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/libtinymail-camel/tny-camel-imap-store-account.c b/libtinymail-camel/tny-camel-imap-store-account.c
index 9de03e9..5fc8b4e 100644
--- a/libtinymail-camel/tny-camel-imap-store-account.c
+++ b/libtinymail-camel/tny-camel-imap-store-account.c
@@ -85,6 +85,9 @@ tny_camel_imap_store_account_factor_folder (TnyCamelStoreAccount *self, const gc
 		if (name && full_name && !strcmp (name, full_name))
 		{
 			folder = TNY_CAMEL_FOLDER (g_object_ref (G_OBJECT (fnd)));
+			TnyCamelFolderPriv *fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (folder);
+			if (priv->cant_reuse_iter)
+				fpriv->cant_reuse_iter = TRUE;
 			*was_new = FALSE;
 			break;
 		}
diff --git a/libtinymail-camel/tny-camel-store-account.c b/libtinymail-camel/tny-camel-store-account.c
index 5ec73e1..5b32915 100644
--- a/libtinymail-camel/tny-camel-store-account.c
+++ b/libtinymail-camel/tny-camel-store-account.c
@@ -1404,6 +1404,10 @@ tny_camel_store_account_factor_folder_default (TnyCamelStoreAccount *self, const
 		if (name && full_name && !strcmp (name, full_name))
 		{
 			folder = TNY_CAMEL_FOLDER (g_object_ref (G_OBJECT (fnd)));
+			TnyCamelFolderPriv *fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (folder);
+			if (priv->cant_reuse_iter)
+				fpriv->cant_reuse_iter = TRUE;
+
 			*was_new = FALSE;
 			break;
 		}
diff --git a/libtinymailui-gtk/tny-gtk-folder-list-store.c b/libtinymailui-gtk/tny-gtk-folder-list-store.c
index c28e351..4207f76 100644
--- a/libtinymailui-gtk/tny-gtk-folder-list-store.c
+++ b/libtinymailui-gtk/tny-gtk-folder-list-store.c
@@ -314,6 +314,7 @@ recurse_folders_async_cb (TnyFolderStore *store,
 				   reference count is decreased automatically by the gtktreestore infra-
 				   structure. */
 
+				add_folder_store_observer_weak (self, TNY_FOLDER_STORE (folder));
 				add_folder_observer_weak (self, folder);
 
 				if (self->flags & TNY_GTK_FOLDER_LIST_STORE_FLAG_SHOW_PATH) {


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