aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-06-05 02:39:34 +0800
committerChris Toshok <toshok@src.gnome.org>2004-06-05 02:39:34 +0800
commit6c9c376c96da32a105598c7a10aba976599d350a (patch)
tree22ec267cdb420e9902b221d7139242146b0e19bc /addressbook/gui/component
parent1f8371a1fdf0c2322fa5280a64bf8550d7152640 (diff)
downloadgsoc2013-evolution-6c9c376c96da32a105598c7a10aba976599d350a.tar.gz
gsoc2013-evolution-6c9c376c96da32a105598c7a10aba976599d350a.tar.zst
gsoc2013-evolution-6c9c376c96da32a105598c7a10aba976599d350a.zip
only resolve destinations against persons, not contact lists.
2004-06-04 Chris Toshok <toshok@ximian.com> * gui/component/select-names/e-select-names-model.c (name_and_email_simple_query_cb): only resolve destinations against persons, not contact lists. svn path=/trunk/; revision=26219
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c
index 877f03a01a..60ad924dcd 100644
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-model.c
@@ -600,30 +600,42 @@ name_and_email_simple_query_cb (EBook *book, EBookStatus status, GList *contacts
ModelDestClosure *c = closure;
EDestination *dest = c->dest;
ESelectNamesModel *model = c->model;
+ EContact *contact;
+ int num_non_list_contacts = 0;
+ GList *l;
g_free (c);
- if (status == E_BOOK_ERROR_OK && g_list_length (contacts) == 1) {
- EContact *contact = E_CONTACT (contacts->data);
- const char *email = e_destination_get_email (dest);
- int email_num = 0;
-
- if (email && *email) {
- GList *email_list = e_contact_get (contact, E_CONTACT_EMAIL);
- GList *l;
-
- for (l = email_list; l; l = l->next) {
- if (!g_ascii_strcasecmp (email, l->data))
- break;
- email_num++;
+ if (status == E_BOOK_ERROR_OK) {
+ for (l = contacts; l; l = l->next) {
+ EContact *c = E_CONTACT (l->data);
+ if (!e_contact_get (c, E_CONTACT_IS_LIST)) {
+ num_non_list_contacts++;
+ contact = c;
}
- if (l == NULL)
- email_num = -1;
}
+
+ if (num_non_list_contacts == 1) {
+ const char *email = e_destination_get_email (dest);
+ int email_num = 0;
- if (email_num >= 0) {
- e_destination_set_contact (dest, contact, email_num);
- e_select_names_model_changed (model);
+ if (email && *email) {
+ GList *email_list = e_contact_get (contact, E_CONTACT_EMAIL);
+ GList *l;
+
+ for (l = email_list; l; l = l->next) {
+ if (!g_ascii_strcasecmp (email, l->data))
+ break;
+ email_num++;
+ }
+ if (l == NULL)
+ email_num = -1;
+ }
+
+ if (email_num >= 0) {
+ e_destination_set_contact (dest, contact, email_num);
+ e_select_names_model_changed (model);
+ }
}
}