[folks] eds: Handle the possibility of E.SourceRegistry being null



commit c7939400effd108163eb2413c5027222d2508dc8
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Jun 18 12:09:08 2012 +0100

    eds: Handle the possibility of E.SourceRegistry being null
    
    Several functions can be called before E.SourceRegistry is set in prepare(),
    so they must cope with it potentially being null.

 backends/eds/lib/edsf-persona-store.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index 875d93b..8b4d8fa 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -237,7 +237,6 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       this._personas_ro = this._personas.read_only_view;
       this._query_str = "(contains \"x-evolution-any-field\" \"\")";
       this.source.changed.connect (this._source_changed_cb);
-      this._notify_if_default ();
     }
 
   ~PersonaStore ()
@@ -634,7 +633,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
               this._source_registry = yield create_source_registry ();
 
               /* We know _source_registry != null because otherwise
-               * E.BookClient.get_sources() would've thrown an error. */
+               * create_source_registry() would've thrown an error. */
               ((!) this._source_registry).source_removed.connect (
                   this._source_registry_changed_cb);
               ((!) this._source_registry).source_disabled.connect (
@@ -650,6 +649,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
               debug ("Successfully finished opening address book %p for " +
                   "persona store â%sâ (%p).", this._addressbook, this.id, this);
 
+              this._notify_if_default ();
               this._update_trust_level ();
             }
           catch (GLib.Error e1)



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