[gnome-contacts] Move the aggregator into the contacts store
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Move the aggregator into the contacts store
- Date: Thu, 30 Jun 2011 13:31:19 +0000 (UTC)
commit 8218001101caab72d02bdc75612d750a987b1d4f
Author: Alexander Larsson <alexl redhat com>
Date: Wed Jun 29 13:37:20 2011 +0200
Move the aggregator into the contacts store
src/contacts-list-pane.vala | 15 ---------------
src/contacts-store.vala | 13 +++++++++++++
2 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index 68da925..a93d4df 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -292,9 +292,6 @@ public class Contacts.ListPane : Frame {
private uint filter_entry_changed_id;
private CellRendererShape shape;
- public IndividualAggregator aggregator { get; private set; }
- public BackendStore backend_store { get; private set; }
-
public signal void selection_changed (Contact? contact);
public signal void create_new ();
@@ -407,18 +404,6 @@ public class Contacts.ListPane : Frame {
public ListPane () {
contacts_store = new Store ();
- aggregator = new IndividualAggregator ();
- aggregator.individuals_changed.connect ((added, removed, m, a, r) => {
- foreach (Individual i in removed) {
- contacts_store.remove (Contact.from_individual (i));
- }
- foreach (Individual i in added) {
- var c = new Contact (i);
- contacts_store.add (c);
- }
- });
- aggregator.prepare ();
-
var toolbar = new Toolbar ();
toolbar.get_style_context ().add_class (STYLE_CLASS_PRIMARY_TOOLBAR);
toolbar.set_icon_size (IconSize.MENU);
diff --git a/src/contacts-store.vala b/src/contacts-store.vala
index 0245f7d..c61562a 100644
--- a/src/contacts-store.vala
+++ b/src/contacts-store.vala
@@ -29,6 +29,7 @@ public class Contacts.Store {
}
ListStore list_store;
+ public IndividualAggregator aggregator { get; private set; }
Gee.ArrayList<ContactData> contacts;
string []? filter_values;
@@ -43,6 +44,18 @@ public class Contacts.Store {
return a.display_name.collate (b.display_name);
});
list_store.set_sort_column_id (0, SortType.ASCENDING);
+
+ aggregator = new IndividualAggregator ();
+ aggregator.individuals_changed.connect ((added, removed, m, a, r) => {
+ foreach (Individual i in removed) {
+ this.remove (Contact.from_individual (i));
+ }
+ foreach (Individual i in added) {
+ var c = new Contact (i);
+ this.add (c);
+ }
+ });
+ aggregator.prepare ();
}
public TreeModel model { get { return list_store; } }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]