diff options
author | Julian Sparber <julian@sparber.net> | 2019-07-18 14:42:02 +0200 |
---|---|---|
committer | Julian Sparber <julian@sparber.net> | 2020-02-02 15:41:54 +0100 |
commit | aa2433307d485b020b8630601dbd1e91b569cea9 (patch) | |
tree | c12cdef068649b54230472c87555cc6136d299d5 /src/contacts-contact-pane.vala | |
parent | 85f80bb9fe3b16c3fc4a82d937b31e971c28bfe7 (diff) | |
download | gnome-contacts-aa2433307d485b020b8630601dbd1e91b569cea9.tar.gz |
Refactor link/unlink operations
This cleans up how linking and unlinking is done, by using the methodes
provided by folks.
Diffstat (limited to 'src/contacts-contact-pane.vala')
-rw-r--r-- | src/contacts-contact-pane.vala | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala index 9e048ef..adaafeb 100644 --- a/src/contacts-contact-pane.vala +++ b/src/contacts-contact-pane.vala @@ -89,10 +89,12 @@ public class Contacts.ContactPane : Stack { this.suggestion_grid.suggestion_accepted.connect ( () => { var linked_contact = this.individual.display_name; - link_contacts.begin (this.individual, i, this.store, (obj, result) => { - var operation = link_contacts.end (result); - this.contacts_linked (null, linked_contact, operation); - }); + var operation = new LinkOperation (this.store); + var to_link = new LinkedList<Individual> (); + to_link.add (this.individual); + to_link.add (i); + operation.do.begin (to_link); + this.contacts_linked (null, linked_contact, operation); remove_suggestion_grid (); }); @@ -260,6 +262,12 @@ public class Contacts.ContactPane : Stack { show_message (e.message); } } + + /* unlink personas */ + if (this.editor.get_unlink_personas ().size > 0) { + var operation = new UnLinkOperation (this.store); + operation.do.begin (this.individual, this.editor.get_unlink_personas ()); + } } public void new_contact () { |