diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2018-03-31 11:48:48 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2018-03-31 11:48:48 +0200 |
commit | e7960b06652703e3d51e53cb675cb0bb0d45a915 (patch) | |
tree | 80f063ce5450c6c5a8886ae2c09a944f6108ebcf | |
parent | c15ea8360df5a87798a34e150a9a131280912cdd (diff) | |
download | gnome-contacts-e7960b06652703e3d51e53cb675cb0bb0d45a915.tar.gz |
Contact: don't needlessly lookup the types of all fields.
This shoudln't be necessary and actually seems to cause some memory
leakage.
-rw-r--r-- | src/contacts-contact.vala | 13 | ||||
-rw-r--r-- | src/contacts-types.vala | 5 |
2 files changed, 0 insertions, 18 deletions
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala index 7f332a7..6c52deb 100644 --- a/src/contacts-contact.vala +++ b/src/contacts-contact.vala @@ -133,8 +133,6 @@ public class Contacts.Contact : GLib.Object { is_main = calc_is_main (); - update (); - individual.notify.connect(notify_cb); } @@ -259,7 +257,6 @@ public class Contacts.Contact : GLib.Object { private bool changed_cb () { this.changed_id = 0; this.is_main = calc_is_main (); - update (); changed (); return false; } @@ -282,16 +279,6 @@ public class Contacts.Contact : GLib.Object { queue_changed (); } - private void update () { - foreach (var email in individual.email_addresses) { - TypeSet.general.type_seen (email); - } - - foreach (var phone in individual.phone_numbers) { - TypeSet.phone.type_seen (phone); - } - } - /* We claim something is "removable" if at least one persona is removable, that will typically unlink the rest. */ public bool can_remove_personas () { diff --git a/src/contacts-types.vala b/src/contacts-types.vala index de8344d..9affca6 100644 --- a/src/contacts-types.vala +++ b/src/contacts-types.vala @@ -209,11 +209,6 @@ public class Contacts.TypeSet : Object { } } - - public void type_seen (AbstractFieldDetails detail) { - lookup_type (detail, null); - } - public string format_type (AbstractFieldDetails detail) { if (detail.parameters.contains (X_GOOGLE_LABEL)) { return Utils.get_first<string> (detail.parameters.get (X_GOOGLE_LABEL)); |