aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-09-28 21:25:12 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-09-28 21:25:12 +0800
commitebef4e5ed565ae236aed1e644bd62fb475e928f8 (patch)
treeaca5df485c16abd1ca0b090b8825a771ee79480f
parentaab7424773357dbe7f60ba18754fa1763b7ee993 (diff)
downloadgsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar.gz
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar.bz2
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar.lz
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar.xz
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.tar.zst
gsoc2013-evolution-ebef4e5ed565ae236aed1e644bd62fb475e928f8.zip
Fix for the crash when adding duplicate contacts without e-mail ids by
dragging them into contact list editor. Patch submitted by "Devashish <sdevashish@novell.com>" svn path=/trunk/; revision=30411
-rw-r--r--addressbook/ChangeLog15
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c16
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c9
3 files changed, 30 insertions, 10 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index eb8f359dca..b2a6c7b17d 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,6 +1,19 @@
2005-09-28 Devashish Sharma <sdevashish@novell.com>
- gui/component/addressbook-view.c (addressbook_view_init): Added a
+ * gui/contact-list-editor/e-contact-list-editor.c
+ (table_drag_data_received_cb): Added a check that the contact received
+ through drag contains an email-id. There is no point in adding a
+ contact to the contact-list if the contact has no email-id. This was
+ causing a crash also.
+
+ * gui/widgets/eab-contact-display.c
+ (eab_contact_display_render_compact): Added a check for catching null
+ email-ids, in case of contact-lists, so that null ids are not passed
+ for rendering, which was causing a crash.
+
+2005-09-28 Devashish Sharma <sdevashish@novell.com>
+
+ * gui/component/addressbook-view.c (addressbook_view_init): Added a
callback, source_selector_key_press_event_callback() so that the
contact folder can be removed with Del/Delete Key.
Fixes #233424.
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 040dbb6b9a..f141f005d9 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -960,12 +960,16 @@ table_drag_data_received_cb (ETable *table, int row, int col,
for (c = contact_list; c; c = c->next) {
EContact *contact = c->data;
- if (!e_contact_get (contact, E_CONTACT_IS_LIST)) {
- e_contact_list_model_add_contact (E_CONTACT_LIST_MODEL (editor->model),
- contact,
- 0 /* Hard-wired for default e-mail */);
-
- changed = TRUE;
+ if (!e_contact_get (contact, E_CONTACT_IS_LIST)) {
+ if (e_contact_get (contact, E_CONTACT_EMAIL)) {
+ e_contact_list_model_add_contact (E_CONTACT_LIST_MODEL (editor->model),
+ contact,
+ 0 /* Hard-wired for default e-mail */);
+
+ changed = TRUE;
+ }
+ else
+ g_warning ("Contact with no email-ids listed can't be added to a Contact-List");
}
}
g_list_foreach (contact_list, (GFunc)g_object_unref, NULL);
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index a925ce72d6..48725d6fcc 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -545,10 +545,13 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac
gtk_html_stream_printf (html_stream, "<b>%s:</b>&nbsp;<td>", _("List Members"));
email_list = e_contact_get (contact, E_CONTACT_EMAIL);
+
for (l = email_list; l; l = l->next) {
- char *html = e_text_to_html (l->data, 0);
- gtk_html_stream_printf (html_stream, "%s, ", html);
- g_free (html);
+ if (l->data) {
+ char *html = e_text_to_html (l->data, 0);
+ gtk_html_stream_printf (html_stream, "%s, ", html);
+ g_free (html);
+ }
}
gtk_html_stream_printf (html_stream, "</td></tr></table>");
}