aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2011-06-30 02:53:42 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-30 02:53:42 +0800
commita6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7 (patch)
treebfdff957bd940bdcb053117b9ccc9837072da3e1 /addressbook
parent5c164275ac5835266ef26d1c9960510c5cc5d555 (diff)
downloadgsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar.gz
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar.bz2
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar.lz
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar.xz
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.tar.zst
gsoc2013-evolution-a6c6699511d9fdf96bb36e5ff4cf7c91c0ca07f7.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.c20
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);