diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-10-06 04:52:01 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-10-06 04:52:01 +0800 |
commit | 1c4fe770ac9faad5103a520598f1755186cf248c (patch) | |
tree | 282fa9cb42575ce4a6441e6aea9b61abe1ac9871 /addressbook/gui/component | |
parent | 7547460503d6d937f93406d01e1feb23e61f6872 (diff) | |
download | gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.gz gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.tar.zst gsoc2013-evolution-1c4fe770ac9faad5103a520598f1755186cf248c.zip |
Check to make sure our call to e_addressbook_model_get_card doesn't return
2001-10-05 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names.c
(real_add_address_cb): Check to make sure our call to
e_addressbook_model_get_card doesn't return NULL.
* gui/widgets/e-addressbook-model.c
(e_addressbook_model_get_card): Chek that we aren't requesting a
negative row.
* gui/contact-list-editor/e-contact-list-editor.c (add_email_cb):
Move to the bottom of the scrolled window, so we can see the
address we just added.
(table_drag_data_received_cb): Move to the bottom of the scrolled
window, so we can see the contact we just dropped.
* gui/component/addressbook.c (addressbook_factory_new_control):
We don't own the string returned by e_categories_master_list_nth,
so terrible things will happen if we free it. (Bug 10916)
svn path=/trunk/; revision=13469
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/addressbook.c | 4 | ||||
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names.c | 19 |
2 files changed, 10 insertions, 13 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index eb7cd4afb5..17e6ed4e3d 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -898,12 +898,10 @@ addressbook_factory_new_control (void) subitems[0].translate = FALSE; for (i=0; i<N; ++i) { - char *category; + const char *category = e_categories_master_list_nth (master_list, i); subitems[i+1].id = i; - category = (char *) e_categories_master_list_nth (master_list, i); subitems[i+1].text = e_utf8_to_locale_string (category); - g_free (category); subitems[i+1].translate = FALSE; } subitems[N+1].id = -1; diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 5a7b2705d0..7b31972dd1 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -198,15 +198,16 @@ real_add_address_cb (int model_row, gpointer closure) mapped_row = e_table_subset_view_to_model_row (E_TABLE_SUBSET (names->without), model_row); - card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(names->model), mapped_row); - - - e_destination_set_card (dest, card, 0); + card = e_addressbook_model_get_card (E_ADDRESSBOOK_MODEL(names->model), mapped_row); + + if (card != NULL) { + e_destination_set_card (dest, card, 0); - e_select_names_model_append (child->source, dest); - e_select_names_model_clean (child->source); + e_select_names_model_append (child->source, dest); + e_select_names_model_clean (child->source); - gtk_object_unref(GTK_OBJECT(card)); + gtk_object_unref(GTK_OBJECT(card)); + } } static void @@ -702,7 +703,6 @@ button_clicked(GtkWidget *button, ESelectNamesChild *child) static void remove_address(ETable *table, int row, int col, GdkEvent *event, ESelectNamesChild *child) { - g_message ("remove row %d", row); e_select_names_model_delete (child->source, row); } @@ -720,8 +720,7 @@ etable_selection_foreach_cb (int row, void *data) /* Build a list of rows in reverse order, then remove them, necessary because otherwise it'll start trying to delete rows out of index in ETableModel */ - selected_rows = g_slist_prepend (selected_rows, - GINT_TO_POINTER (row)); + selected_rows = g_slist_prepend (selected_rows, GINT_TO_POINTER (row)); } static void |