Commit 4be138f8 authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'wip/347-folks-loading-slow' into 'master'

Init Folks in backgroud to prevent blocking UI on startup

Closes #347

See merge request !185
parents 598a1d02 8ee768fb
Pipeline #71790 passed with stages
in 30 minutes and 19 seconds
...@@ -263,11 +263,16 @@ public class GearyController : Geary.BaseObject { ...@@ -263,11 +263,16 @@ public class GearyController : Geary.BaseObject {
Folks.IndividualAggregator individuals = Folks.IndividualAggregator individuals =
Folks.IndividualAggregator.dup(); Folks.IndividualAggregator.dup();
if (!individuals.is_prepared) { if (!individuals.is_prepared) {
try { // Do this in the background since it can take a long time
yield individuals.prepare(); // on some systems and the GUI shouldn't be blocked by it
} catch (GLib.Error err) { individuals.prepare.begin((obj, res) => {
error("Error preparing Folks: %s", err.message); try {
} individuals.prepare.end(res);
} catch (GLib.Error err) {
warning("Error preparing Folks: %s", err.message);
}
});
} }
this.avatar_store = new Application.AvatarStore(individuals); this.avatar_store = new Application.AvatarStore(individuals);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment