diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-21 14:08:52 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2018-01-21 14:08:52 +0100 |
commit | e4b39a6ffca43ca022c1f90ddc3b28c8cae2205c (patch) | |
tree | 6acda95a9a71ee469d3241df35491db765c245c4 /src/contacts-contact.vala | |
parent | 16fd4f2919fd6760053ed4e8f47b8e86c094e01f (diff) | |
download | gnome-contacts-e4b39a6ffca43ca022c1f90ddc3b28c8cae2205c.tar.gz |
ContactList: use a SimpleQuery for the search filter.
This also lets us remove a lot of code where the filtered-status of a
contact was saved (which led to more memory usage). So hurray for less
bloat and less memory usage!
Diffstat (limited to 'src/contacts-contact.vala')
-rw-r--r-- | src/contacts-contact.vala | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala index 82d2f6e..5073a68 100644 --- a/src/contacts-contact.vala +++ b/src/contacts-contact.vala @@ -51,8 +51,6 @@ public class Contacts.Contact : GLib.Object { return false; } - private string filter_data; - public signal void changed (); public signal void personas_changed (); @@ -172,14 +170,6 @@ public class Contacts.Contact : GLib.Object { return false; } - public bool contains_strings (string [] strings) { - foreach (string i in strings) { - if (! (i in filter_data)) - return false; - } - return true; - } - private static bool has_pref (AbstractFieldDetails details) { var evolution_pref = details.get_parameter_values ("x-evolution-ui-slot"); if (evolution_pref != null && Utils.get_first (evolution_pref) == "1") @@ -364,39 +354,6 @@ public class Contacts.Contact : GLib.Object { queue_changed (false); } - private void update_filter_data () { - var builder = new StringBuilder (); - if (individual.alias != null) { - builder.append (Utils.canonicalize_for_search (individual.alias)); - builder.append_unichar (' '); - } - if (individual.full_name != null) { - builder.append (Utils.canonicalize_for_search (individual.full_name)); - builder.append_unichar (' '); - } - if (individual.nickname != null) { - builder.append (Utils.canonicalize_for_search (individual.nickname)); - builder.append_unichar (' '); - } - var im_addresses = individual.im_addresses; - foreach (var detail in im_addresses.get_values ()) { - var addr = detail.value; - builder.append (addr.casefold ()); - builder.append_unichar (' '); - } - var emails = individual.email_addresses; - foreach (var email in emails) { - builder.append (email.value.casefold ()); - builder.append_unichar (' '); - } - var phone_numbers = individual.phone_numbers; - foreach (var phone in phone_numbers) { - builder.append (phone.value.casefold ()); - builder.append_unichar (' '); - } - filter_data = builder.str; - } - private void update () { foreach (var email in individual.email_addresses) { TypeSet.general.type_seen (email); @@ -405,8 +362,6 @@ public class Contacts.Contact : GLib.Object { foreach (var phone in individual.phone_numbers) { TypeSet.phone.type_seen (phone); } - - update_filter_data (); } /* We claim something is "removable" if at least one persona is removable, |