[gnome-contacts] Store: remove eds_persona_store_changed()
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Store: remove eds_persona_store_changed()
- Date: Tue, 11 Dec 2018 01:05:42 +0000 (UTC)
commit f48cf192820504f59c78f3d2fb0869f91a2321e9
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue Dec 11 02:01:40 2018 +0100
Store: remove eds_persona_store_changed()
Due to a race condition, a persona store could be available _before_ the
signal was handled. That meant that sometimes this signal wasn't
triggered when it really should've been. The easy fix (and imho) cleaner
solution is to not provide any E-D-S specific behaviour, and to just
listen to newly available backends in general.
Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/issues/114.
src/contacts-app.vala | 2 +-
src/contacts-setup-window.vala | 2 +-
src/contacts-store.vala | 12 ------------
3 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 47e99ac..c3edf6f 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -138,7 +138,7 @@ public class Contacts.App : Gtk.Application {
acc.disconnect (active_button_once);
});
- ulong stores_changed_id = contacts_store.eds_persona_store_changed.connect ( () => {
+ ulong stores_changed_id = contacts_store.backend_store.backend_available.connect (() => {
acc.update_contents (true);
});
diff --git a/src/contacts-setup-window.vala b/src/contacts-setup-window.vala
index 4b13a85..ea23e5b 100644
--- a/src/contacts-setup-window.vala
+++ b/src/contacts-setup-window.vala
@@ -43,7 +43,7 @@ public class Contacts.SetupWindow : Gtk.ApplicationWindow {
this.content.add (this.setup_accounts_list);
// Listen for changes
- store.eds_persona_store_changed.connect ( () => {
+ store.backend_store.backend_available.connect ( () => {
this.setup_accounts_list.update_contents (false);
});
diff --git a/src/contacts-store.vala b/src/contacts-store.vala
index 96c9d04..1a033fb 100644
--- a/src/contacts-store.vala
+++ b/src/contacts-store.vala
@@ -25,8 +25,6 @@ public class Contacts.Store : GLib.Object {
public signal void quiescent ();
public signal void prepared ();
- public signal void eds_persona_store_changed ();
-
public IndividualAggregator aggregator { get; private set; }
public BackendStore backend_store { get { return this.aggregator.backend_store; } }
private ArrayList<Contact> contacts;
@@ -135,16 +133,6 @@ public class Contacts.Store : GLib.Object {
read_dont_suggest_db ();
var backend_store = BackendStore.dup ();
- backend_store.backend_available.connect ((backend) => {
- if (backend.name == "eds") {
- backend.persona_store_added.connect (() => {
- eds_persona_store_changed ();
- });
- backend.persona_store_removed.connect (() => {
- eds_persona_store_changed ();
- });
- }
- });
this.aggregator = IndividualAggregator.dup_with_backend_store (backend_store);
aggregator.notify["is-quiescent"].connect ( (obj, pspec) => {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]