[folks] Edsf.PersonaStore: defer contacts-complete like contacts-added



commit 62fe0c462b4662bc72e8485fb1d6ea09617a2410
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Mar 26 19:13:46 2013 +0000

    Edsf.PersonaStore: defer contacts-complete like contacts-added
    
    Otherwise, we signal quiescence while not actually quiescent: our
    initial batch of contacts could still be coming in.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=696659
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Philip Withnall <philip tecnocode co uk>

 backends/eds/lib/edsf-persona-store.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index dae25fa..0a2c292 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -2502,6 +2502,13 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       Internal.profiling_point ("initial query complete in " +
           "Edsf.PersonaStore (ID: %s)", this.id);
 
+      /* Do the rest in an idle, so we don't signal that we are quiescent
+       * before we actually have everyone. */
+      this._idle_queue (() => { return this._contacts_complete_idle_cb (err); });
+    }
+
+  private bool _contacts_complete_idle_cb (Error err)
+    {
       /* The initial query is complete, so signal that we've reached
        * quiescence (even if there was an error). */
       if (this._is_quiescent == false)
@@ -2512,7 +2519,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
               warning ("Error is considered unrecoverable. " +
                   "Removing persona store.");
               this.removed ();
-              return;
+              return false;
             }
 
           /* Emit a notification about all the personas which were found in the
@@ -2531,6 +2538,8 @@ public class Edsf.PersonaStore : Folks.PersonaStore
           this._is_quiescent = true;
           this.notify_property ("is-quiescent");
         }
+
+      return false;
     }
 
   /* Convert an EClientError or EBookClientError to a Folks.PropertyError for


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