From c7b0f21667190f7705c10b8cf4d7a13bd882008f Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 27 Feb 2001 04:06:20 +0000 Subject: Prevent `gtk_signal_disconnect()' warnings when destroying a non-grouping ETable by only disconnecting the signals that are actually connected. svn path=/trunk/; revision=8401 --- widgets/table/e-table.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index abda473a97..ec58ad5186 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -121,16 +121,24 @@ static gint et_focus (GtkContainer *container, GtkDirectionType direction); static void et_disconnect_model (ETable *et) { - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_model_change_id); - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_row_change_id); - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_cell_change_id); - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_row_inserted_id); - gtk_signal_disconnect (GTK_OBJECT (et->model), - et->table_row_deleted_id); + if (et->model == NULL) + return; + + if (et->table_model_change_id != 0) + gtk_signal_disconnect (GTK_OBJECT (et->model), + et->table_model_change_id); + if (et->table_row_change_id != 0) + gtk_signal_disconnect (GTK_OBJECT (et->model), + et->table_row_change_id); + if (et->table_cell_change_id != 0) + gtk_signal_disconnect (GTK_OBJECT (et->model), + et->table_cell_change_id); + if (et->table_row_inserted_id != 0) + gtk_signal_disconnect (GTK_OBJECT (et->model), + et->table_row_inserted_id); + if (et->table_row_deleted_id != 0) + gtk_signal_disconnect (GTK_OBJECT (et->model), + et->table_row_deleted_id); et->table_model_change_id = 0; et->table_row_change_id = 0; -- cgit