diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-05-20 20:24:06 +0800 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-05-20 20:24:06 +0800 |
commit | 71c0e4e0c2d5d8dfc8ab97650256c11108ffacba (patch) | |
tree | 1d8af9ec47f8b8c972d424f49d9a7c6b5ff5f66f | |
parent | 428f26b128cf34f30e053584b07d29b1b44b0a36 (diff) | |
download | gsoc2013-evolution-71c0e4e0c2d5d8dfc8ab97650256c11108ffacba.tar.gz gsoc2013-evolution-71c0e4e0c2d5d8dfc8ab97650256c11108ffacba.tar.zst gsoc2013-evolution-71c0e4e0c2d5d8dfc8ab97650256c11108ffacba.zip |
Consider full name and also the first part of e-mail address for
contact description in the import dialogue.
-rw-r--r-- | addressbook/importers/evolution-vcard-importer.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 49e7bef70b..59aba913d2 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -868,6 +868,7 @@ evolution_contact_importer_get_preview_widget (const GList *contacts) for (c = contacts; c; c = c->next) { const gchar *description; + gchar *free_description = NULL; EContact *contact = (EContact *) c->data; if (!contact || !E_IS_CONTACT (contact)) @@ -876,12 +877,26 @@ evolution_contact_importer_get_preview_widget (const GList *contacts) description = e_contact_get_const (contact, E_CONTACT_FILE_AS); if (!description) description = e_contact_get_const (contact, E_CONTACT_UID); + if (!description) + description = e_contact_get_const (contact, E_CONTACT_FULL_NAME); + if (!description) { + description = e_contact_get_const (contact, E_CONTACT_EMAIL_1); + if (description) { + const gchar *at = strchr (description, '@'); + if (at) { + free_description = g_strndup (description, (gsize)(at - description)); + description = free_description; + } + } + } gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, description ? description : "", 1, contact, -1 ); + + g_free (free_description); } if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) { |