[geary/gnome-3-32] Merge branch 'wip/347-folks-loading-slow' into 'master'



commit ce63e3c072306627b3421b11b1f910c43bec1119
Author: Michael Gratton <mike vee net>
Date:   Fri Mar 29 22:41:59 2019 +0000

    Merge branch 'wip/347-folks-loading-slow' into 'master'
    
    Init Folks in backgroud to prevent blocking UI on startup
    
    Closes #347
    
    See merge request GNOME/geary!185
    
    (cherry picked from commit 4be138f8109d98ae80a98f1bc29bb0c7620d0f83)
    
    8ee768fb Init Folks in the backgroud to prevent blocking the UI on startup

 src/client/application/geary-controller.vala | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 5b9cab13..bcc3ace7 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -263,11 +263,16 @@ public class GearyController : Geary.BaseObject {
         Folks.IndividualAggregator individuals =
             Folks.IndividualAggregator.dup();
         if (!individuals.is_prepared) {
-            try {
-                yield individuals.prepare();
-            } catch (GLib.Error err) {
-                error("Error preparing Folks: %s", err.message);
-            }
+            // Do this in the background since it can take a long time
+            // on some systems and the GUI shouldn't be blocked by it
+            individuals.prepare.begin((obj, res) => {
+                    try {
+                        individuals.prepare.end(res);
+                    } catch (GLib.Error err) {
+                        warning("Error preparing Folks: %s", err.message);
+                    }
+                });
+
         }
         this.avatar_store = new Application.AvatarStore(individuals);
 


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