Patch: cancel account operations on removing account from folder list store



	Hi,

	This patch executes a tny_account_cancel on accounts removed from the
list store if there's a get folders attempt in progress.

	This will allow to "force a stop" of operations from other layers, and
specifically, the get folders done internally by the folder list store.

Changelog:
    * libtinymailui-gtk/tny-gtk-folder-list-store.c: cancel account
      operations on removing them from store (to allow stopping get
      folders operation).

-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index 2565899..9c40e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,10 @@
 	is now disabled, as we usually get hte connection event too 
 	soon.
 
+	* libtinymailui-gtk/tny-gtk-folder-list-store.c: cancel account
+	operations on removing them from store (to allow stopping get
+	folders operation).
+
 2009-06-16  Jose Dapena Paz  <jdapena igalia com>
 
 	* New libtinymail-camel/tny-camel-html-to-text-stream.[ch]:
diff --git a/libtinymailui-gtk/tny-gtk-folder-list-store.c b/libtinymailui-gtk/tny-gtk-folder-list-store.c
index 30811bc..6d0069a 100644
--- a/libtinymailui-gtk/tny-gtk-folder-list-store.c
+++ b/libtinymailui-gtk/tny-gtk-folder-list-store.c
@@ -1028,6 +1028,8 @@ tny_gtk_folder_list_store_remove (TnyList *self, GObject* item)
 					if ((GObject *) account == item) {
 						more_items = gtk_list_store_remove (GTK_LIST_STORE (me), &iter);
 						deleted = TRUE;
+						if (TNY_GTK_FOLDER_LIST_STORE (self)->progress_count > 0)
+							tny_account_cancel (TNY_ACCOUNT (account));
 					}
 					g_object_unref (account);
 				}


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