Patch: add a "no refresh" flag to the gtk folder list store



	Hi,

	This patch adds a "no refresh" flag for the gtk folder list store. This
is required for allowing creating folder list stores that don't force
full refreshes (for example, with transient dialogs when the main
"folder view" of UI is a different one).

Changelog entry:
* libtinymailui-gtk/tny-gtk-folder-list-store.c:
  added flag "no refresh" to allow creating folder list stores
  that don't do any "forced" refresh (unless it's caused by
  reconnects).


-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index 0ce3660..05df45f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-23  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymailui-gtk/tny-gtk-folder-list-store.c:
+	added flag "no refresh" to allow creating folder list stores
+	that don't do any "forced" refresh (unless it's caused by
+	reconnects).
+
 2009-04-14  Sergio Villar Senin  <svillar igalia com>
 
 	* libtinymail/tny-progress-info.c (tny_progress_info_idle_func):
diff --git a/libtinymailui-gtk/tny-gtk-folder-list-store.c b/libtinymailui-gtk/tny-gtk-folder-list-store.c
index 1ed8468..942d0f6 100644
--- a/libtinymailui-gtk/tny-gtk-folder-list-store.c
+++ b/libtinymailui-gtk/tny-gtk-folder-list-store.c
@@ -309,7 +309,8 @@ recurse_folders_async_cb (TnyFolderStore *store,
 				add_folder_store_observer_weak (self, folder_store);
 				self->progress_count++;
 				tny_folder_store_get_folders_async (folder_store,
-								    folders, NULL, TRUE,
+								    folders, NULL, 
+								    !(self->flags & TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH),
 								    recurse_folders_async_cb,
 								    NULL, g_object_ref (self));
 				g_object_unref (folders);
@@ -426,7 +427,8 @@ get_folders_cb (TnyFolderStore *fstore, gboolean cancelled, TnyList *list, GErro
 			g_signal_emit (self, tny_gtk_folder_list_store_signals[ACTIVITY_CHANGED_SIGNAL], 0, TRUE);
 		}
 		tny_folder_store_get_folders_async (fstore,
-						    folders, NULL, TRUE,
+						    folders, NULL, 
+						    !(self->flags & TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH),
 						    recurse_folders_async_cb,
 						    NULL, g_object_ref (self));
 		g_object_unref (folders);
@@ -648,7 +650,9 @@ tny_gtk_folder_list_store_add_i (TnyGtkFolderListStore *self, TnyFolderStore *fo
 		g_signal_emit (self, tny_gtk_folder_list_store_signals[ACTIVITY_CHANGED_SIGNAL], 0, TRUE);
 	}
 	tny_folder_store_get_folders_async (TNY_FOLDER_STORE (folder_store), 
-		folders, self->query, TRUE,  get_folders_cb, NULL, g_object_ref (self));
+					    folders, self->query, 
+					    !(self->flags & TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH),  
+					    get_folders_cb, NULL, g_object_ref (self));
 
 	/* Add an observer for the root folder store, so that we can observe 
 	 * the actual account too. */
diff --git a/libtinymailui-gtk/tny-gtk-folder-list-store.h b/libtinymailui-gtk/tny-gtk-folder-list-store.h
index 610490c..28ecf9e 100644
--- a/libtinymailui-gtk/tny-gtk-folder-list-store.h
+++ b/libtinymailui-gtk/tny-gtk-folder-list-store.h
@@ -57,6 +57,7 @@ typedef enum _TnyGtkFolderListStoreColumn TnyGtkFolderListStoreColumn;
 enum _TnyGtkFolderListStoreFlags
 {
 	TNY_GTK_FOLDER_LIST_STORE_FLAG_SHOW_PATH = 1<<0,
+	TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH = 1<<2,
 };
 
 typedef enum _TnyGtkFolderListStoreFlags TnyGtkFolderListStoreFlags;


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