Actually fall back to eds:system in case there's no default address book.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 26 Sep 2011 16:44:39 +0000 (09:44 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 26 Sep 2011 22:32:48 +0000 (15:32 -0700)
Closes: bgo#660140 - contacts_contact_find_persona_from_store: assertion `store
!= NULL' failed

NEWS
backends/eds/lib/edsf-persona-store.vala

diff --git a/NEWS b/NEWS
index 3c22e2c..5d97b51 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Overview of changes from libfolks 0.6.3.1 to libfolks 0.6.4
 ===========================================================
+* Bug 660140 — contacts_contact_find_persona_from_store: assertion `store !=
+  NULL' failed
 
 Overview of changes from libfolks 0.6.3 to libfolks 0.6.3.1
 ===========================================================
index c92b34e..61d5d6f 100644 (file)
@@ -1946,9 +1946,25 @@ public class Edsf.PersonaStore : Folks.PersonaStore
   private void _notify_if_default ()
     {
       bool is_default = false;
-      if (this._source.get_property ("default") == "true")
+
+      E.SourceList sources;
+      try
+        {
+          /* By peeking at the default source instead of checking the value of
+           * the "default" property, we include EDS's fallback logic for the
+           * "system" address book */
+          E.BookClient.get_sources (out sources);
+          var default_source = sources.peek_default_source ();
+          if (default_source != null &&
+              this._source.peek_uid () == default_source.peek_uid ())
+            {
+              is_default = true;
+            }
+        }
+      catch (GLib.Error e)
         {
-          is_default = true;
+          warning ("Failed to get the set of ESources while looking for a " +
+              "default address book: %s", e);
         }
 
       if (is_default != this.is_user_set_default)