From 7b226f961c3340d85cff72b2b4485677ddfddb1d Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 5 Jun 2001 17:53:04 +0000 Subject: Change the completion handler to use the ECompletionMatch. 2001-06-05 Jon Trowbridge * gui/component/select-names/e-select-names-manager.c (completion_handler): Change the completion handler to use the ECompletionMatch. * gui/component/select-names/e-select-names-completion.c General changes to convert for ECompletionMatch use. (emailify_match): Use extra sort keys in ECompletionMatch to let us ensure that the primary email address is always the first option, the secondary comes second, etc. There was no nice way to do this previously. (match_name): Removed code that adjusted score based on similarities between the "real name" and the e-mail address. It seemed like a good idea at the time, but produced unexpected and confusing results. svn path=/trunk/; revision=10120 --- addressbook/gui/component/select-names/e-select-names-manager.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names-manager.c') diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index 6c06624918..9361cfa836 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -267,17 +267,18 @@ entry_destroyed(EEntry *entry, ESelectNamesManager *manager) } static void -completion_handler (EEntry *entry, const gchar *text, gpointer user_data) +completion_handler (EEntry *entry, ECompletionMatch *match) { ESelectNamesModel *snm; EDestination *dest; gint i, pos, start_pos, len; - if (user_data == NULL) + if (match == NULL || match->user_data == NULL) return; + snm = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (entry), "select_names_model")); - dest = E_DESTINATION (user_data); + dest = E_DESTINATION (match->user_data); /* Sometimes I really long for garbage collection. Reference counting makes you feel 31337, but sometimes it is just a -- cgit v1.2.3