[gnome-contacts/new-design] Update everything when personas changes for the visible contact



commit f191602d433c49e613759985bf9280093975b79e
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 12 12:19:51 2011 +0100

    Update everything when personas changes for the visible contact

 src/contacts-contact-pane.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index fa6f976..8c58942 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -952,10 +952,20 @@ public class Contacts.ContactPane : ScrolledWindow {
   }
 
   public void show_contact (Contact? new_contact, bool edit=false) {
+    if (contact != null)
+      contact.personas_changed.disconnect (personas_changed_cb);
+
     contact = new_contact;
 
     update_card ();
     update_personas ();
+
+    if (contact != null)
+      contact.personas_changed.connect (personas_changed_cb);
+  }
+
+  private void personas_changed_cb (Contact contact) {
+    update_personas ();
   }
 
   public void new_contact (ListPane list_pane) {



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