[geary: 2/3] Only rebuild copy/move toolbars when switching accounts



commit 3ea103eb946fae5cbb5df919beefff7ed59712a9
Author: Erik Faye-Lund <erik faye-lund collabora com>
Date:   Wed Sep 12 11:49:22 2018 +0200

    Only rebuild copy/move toolbars when switching accounts
    
    When working on accounts with a *lot* of folders on slow servers, this
    can be very slow. So let's try to only do it when it's actually needed;
    when switching accounts.

 src/client/application/geary-controller.vala | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 94db7488..91462e91 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1407,6 +1407,13 @@ public class GearyController : Geary.BaseObject {
                 
                 pending_mailtos.clear();
             }
+
+            main_window.main_toolbar.copy_folder_menu.clear();
+            main_window.main_toolbar.move_folder_menu.clear();
+            foreach(Geary.Folder f in current_folder.account.list_folders()) {
+                main_window.main_toolbar.copy_folder_menu.add_folder(f);
+                main_window.main_toolbar.move_folder_menu.add_folder(f);
+            }
         }
         
         folder_selected(current_folder);
@@ -1414,13 +1421,6 @@ public class GearyController : Geary.BaseObject {
         if (!(current_folder is Geary.SearchFolder))
             previous_non_search_folder = current_folder;
         
-        main_window.main_toolbar.copy_folder_menu.clear();
-        main_window.main_toolbar.move_folder_menu.clear();
-        foreach(Geary.Folder f in current_folder.account.list_folders()) {
-            main_window.main_toolbar.copy_folder_menu.add_folder(f);
-            main_window.main_toolbar.move_folder_menu.add_folder(f);
-        }
-        
         // disable copy/move to the new folder
         main_window.main_toolbar.copy_folder_menu.enable_disable_folder(current_folder, false);
         main_window.main_toolbar.move_folder_menu.enable_disable_folder(current_folder, false);


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