11
11
public enum Column {
13
13
CONTACT_MARKUP_NAME,
16
16
public static Type[] get_types() {
18
18
typeof (Geary.Contact), // CONTACT_OBJECT
19
19
typeof (string), // CONTACT_MARKUP_NAME
20
typeof (string) // LAST_KEY
20
typeof (Gee.HashSet) // PRIOR_KEYS
59
59
// Highlighted result should be Markup.escaped for presentation to the user
60
60
public void set_highlighted_result(Gtk.TreeIter iter, string highlighted_result,
61
61
string current_address_key) {
62
// get the last key for this row for comparison
63
GLib.Value last_key_value;
64
get_value(iter, Column.LAST_KEY, out last_key_value);
65
string? last_key = last_key_value.get_string();
62
// get the previous keys for this row for comparison
63
GLib.Value prior_keys_value;
64
get_value(iter, Column.PRIOR_KEYS, out prior_keys_value);
65
Gee.HashSet<string> prior_keys = (Gee.HashSet<string>) prior_keys_value.get_object();
67
67
// Changing a row in the list store causes Gtk.EntryCompletion to re-evaluate
68
68
// completion_match_func for that row. Thus we need to make sure the key has
69
69
// actually changed before settings the highlighting--otherwise we will cause
70
70
// an infinite loop.
71
if (current_address_key != last_key) {
73
Column.CONTACT_MARKUP_NAME, highlighted_result,
74
Column.LAST_KEY, current_address_key, -1);
71
if (!(current_address_key in prior_keys)) {
72
prior_keys.add(current_address_key);
73
set(iter, Column.CONTACT_MARKUP_NAME, highlighted_result, -1);
86
85
Column.CONTACT_OBJECT, contact,
87
86
Column.CONTACT_MARKUP_NAME, Markup.escape_text(full_address),
87
Column.PRIOR_KEYS, new Gee.HashSet<string>());
91
90
private void update_contact(Geary.Contact updated_contact) {