diff options
author | Milan Crha <mcrha@redhat.com> | 2009-11-04 20:01:11 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-11-04 20:01:11 +0800 |
commit | 62c105cfab0cbeba77ab2b2a14afe7546d6703a0 (patch) | |
tree | c9508f086da4ccae1eb720ebe109d0cb8799aad3 /calendar/gui/e-select-names-renderer.c | |
parent | 7d66ca379652ce979da24ed18315c76a4a6865ec (diff) | |
download | gsoc2013-evolution-62c105cfab0cbeba77ab2b2a14afe7546d6703a0.tar.gz gsoc2013-evolution-62c105cfab0cbeba77ab2b2a14afe7546d6703a0.tar.zst gsoc2013-evolution-62c105cfab0cbeba77ab2b2a14afe7546d6703a0.zip |
Bug #596827 - Don't remove meeting attendees after edit
Diffstat (limited to 'calendar/gui/e-select-names-renderer.c')
-rw-r--r-- | calendar/gui/e-select-names-renderer.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 0f82c3237e..bb0698fa29 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -53,7 +53,7 @@ G_DEFINE_TYPE (ESelectNamesRenderer, e_select_names_renderer, GTK_TYPE_CELL_REND static void e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell) { - GList *addresses = NULL, *names = NULL; + GList *addresses = NULL, *names = NULL, *a, *n; /* We don't need to listen for the focus out event any more */ g_signal_handlers_disconnect_matched (editable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, cell); @@ -66,6 +66,23 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRen addresses = e_select_names_editable_get_emails (E_SELECT_NAMES_EDITABLE (editable)); names = e_select_names_editable_get_names (E_SELECT_NAMES_EDITABLE (editable)); + /* remove empty addresses */ + for (a = addresses, n = names; a && n; ) { + gchar *addr = a->data, *nm = n->data; + + if ((!addr || !*addr) && (!nm || !*nm)) { + g_free (addr); + g_free (nm); + addresses = g_list_remove_link (addresses, a); + names = g_list_remove_link (names, n); + a = addresses; + n = names; + } else { + a = a->next; + n = n->next; + } + } + g_signal_emit (cell, signals [CELL_EDITED], 0, cell->priv->path, addresses, names); g_list_foreach (addresses, (GFunc)g_free, NULL); |