diff options
author | Dan Vrátil <dvratil@redhat.com> | 2011-06-30 02:53:42 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:08:33 +0800 |
commit | a624e7b4836cf810a528ea422e9961b2babf88fc (patch) | |
tree | 3ffca6d02a1b8df6b8dcbe63f4b0d2672cc64948 /addressbook | |
parent | b9ee422f50e9c634baa674347a139807b8085a5e (diff) | |
download | gsoc2013-evolution-a624e7b4836cf810a528ea422e9961b2babf88fc.tar.gz gsoc2013-evolution-a624e7b4836cf810a528ea422e9961b2babf88fc.tar.zst gsoc2013-evolution-a624e7b4836cf810a528ea422e9961b2babf88fc.zip |
Bug #653644 - Warning when adding plain address into a contact list
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index a0de8a5c8a..41c9f27ae9 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -191,7 +191,6 @@ contact_list_editor_add_destination (GtkWidget *widget, { EContactListEditor *editor = contact_list_editor_extract (widget); EContactListModel *model = E_CONTACT_LIST_MODEL (editor->priv->model); - EDestinationStore *dest_store; GtkTreeView *treeview = GTK_TREE_VIEW (WIDGET (TREE_VIEW)); GtkTreePath *path; gboolean ignore_conflicts = TRUE; @@ -244,9 +243,6 @@ contact_list_editor_add_destination (GtkWidget *widget, gtk_tree_view_expand_to_path (treeview, path); gtk_tree_path_free (path); - dest_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY (WIDGET (EMAIL_ENTRY))); - e_destination_store_remove_destination (dest_store, dest); - return TRUE; } @@ -257,10 +253,21 @@ static void contact_list_editor_add_email (EContactListEditor *editor, const gchar *email) { + CamelInternetAddress *addr; EContactListEditorPrivate *priv = editor->priv; - EDestination *dest = e_destination_new (); - e_destination_set_email (dest, email); + + addr = camel_internet_address_new (); + if (camel_address_unformat (CAMEL_ADDRESS (addr), email) == 1) { + const gchar *name, *mail; + camel_internet_address_get (addr, 0, &name, &mail); + e_destination_set_email (dest, mail); + e_destination_set_name (dest, name); + } else { + e_destination_set_email (dest, email); + } + g_object_unref (addr); + priv->changed = contact_list_editor_add_destination (WIDGET (DIALOG), dest) || priv->changed; contact_list_editor_update (editor); @@ -872,6 +879,7 @@ contact_list_editor_select_button_clicked_cb (GtkWidget *widget) EDestination *destination = iter->data; contact_list_editor_add_destination (widget, destination); + e_destination_store_remove_destination (store, destination); } g_list_free (list); |