[gnome-contacts] ContactPane: set Store property after construction



commit 1d65bb4da64bb99500451b7c28b03ee6aac65e94
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu May 15 22:37:25 2014 -0400

    ContactPane: set Store property after construction
    
    The point of this commit is allow the creation of an unique Store object
    belonging to Contacts.App. Further along we'll make more changes in this direction

 src/contacts-contact-pane.vala |    5 ++++-
 src/contacts-window.ui         |    1 -
 src/contacts-window.vala       |   12 +++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index cfc868f..5f19b7e 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -55,8 +55,11 @@ public class Contacts.ContactPane : Notebook {
 
       // Refresh the view when the store is quiescent as we may have missed
       // some potential matches while the store was still preparing.
-      _store.quiescent.connect (update_sheet);
+      if (value != null) {
+       _store.quiescent.connect (update_sheet);
+      }
     }
+    default = null;
   }
 
   public Contact? contact;
diff --git a/src/contacts-window.ui b/src/contacts-window.ui
index 99ad6b9..1f93576 100644
--- a/src/contacts-window.ui
+++ b/src/contacts-window.ui
@@ -31,7 +31,6 @@
                     <property name="can_focus">False</property>
                     <child>
                       <object class="ContactsContactPane" id="contact_pane">
-                        <property name="store">contacts_store</property>
                         <property name="show_tabs">False</property>
                         <property name="visible">True</property>
                         <property name="hexpand">True</property>
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index fe7af25..509c611 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -80,9 +80,15 @@ public class Contacts.Window : Gtk.ApplicationWindow {
     }
   }
 
-  public Window (Gtk.Application app) {
-    Object (application: app);
-    App.app.contacts_store = contacts_store;
+  public Store store {
+    get; construct set;
+  }
+
+  public Window (Gtk.Application app, Store contacts_store) {
+    Object (application: app, store: contacts_store);
+    debug ("everyone creation: finalized already!!!");
+
+    contact_pane.store = contacts_store;
 
     /* FIXME: order me, debug code */
     if (true) { /* setup is done ? */


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