diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-09 11:11:33 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-09 11:11:33 +0800 |
commit | 0b1546202c75992262a3da84bcf8adf2c216022a (patch) | |
tree | 5ced1ebdf4adcf466a2f9b66f92097a240407b37 /addressbook/gui/component/select-names/e-select-names-table-model.c | |
parent | 2fb9565ed501cc57da1ca42ff540fd123c00ba48 (diff) | |
download | gsoc2013-evolution-0b1546202c75992262a3da84bcf8adf2c216022a.tar.gz gsoc2013-evolution-0b1546202c75992262a3da84bcf8adf2c216022a.tar.zst gsoc2013-evolution-0b1546202c75992262a3da84bcf8adf2c216022a.zip |
parent class is GObjectClass.
2002-11-08 Chris Toshok <toshok@ximian.com>
* gui/component/select-names/e-select-names-model.h: parent class
is GObjectClass.
* gui/component/select-names/e-simple-card-bonobo.c
(impl_dispose): guard against multiple invocations, and chain
dispose.
* gui/component/select-names/e-select-names.c
(e_select_names_dispose): guard against multiple invocations.
* gui/component/select-names/e-select-names-text-model.c
(e_select_names_text_model_dispose): guard against multiple
invocations.
(e_select_names_text_model_set_source): fix casts.
* gui/component/select-names/e-select-names-table-model.c
(e_select_names_table_model_add_source): remove the GTK_OBJECT
cast, fixes a warning.
(clear_info): guard against multiple invocations from ::dispose.
* gui/component/select-names/e-select-names-manager.c
(e_select_names_manager_dispose): same.
* gui/component/select-names/e-select-names-completion.c
(e_select_names_completion_dispose): same.
* gui/component/select-names/e-select-names-bonobo.c
(impl_dispose): guard against multiple invocations.
svn path=/trunk/; revision=18681
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-table-model.c')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-table-model.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c index 476d009844..04c6a80f88 100644 --- a/addressbook/gui/component/select-names/e-select-names-table-model.c +++ b/addressbook/gui/component/select-names/e-select-names-table-model.c @@ -27,12 +27,13 @@ enum { static void e_select_names_table_model_init (ESelectNamesTableModel *model); static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass); -static void e_select_names_table_model_destroy (GtkObject *object); +static void e_select_names_table_model_dispose (GObject *object); static void e_select_names_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void e_select_names_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_select_names_table_model_model_changed (ESelectNamesModel *source, ESelectNamesTableModel *model); +static ETableModelClass *parent_class = NULL; static void e_select_names_table_model_add_source (ESelectNamesTableModel *model, @@ -41,9 +42,9 @@ e_select_names_table_model_add_source (ESelectNamesTableModel *model, model->source = source; if (model->source) g_object_ref(model->source); - model->source_changed_id = g_signal_connect(GTK_OBJECT(model->source), "changed", - G_CALLBACK(e_select_names_table_model_model_changed), - model); + model->source_changed_id = g_signal_connect(model->source, "changed", + G_CALLBACK(e_select_names_table_model_model_changed), + model); } static void @@ -145,14 +146,16 @@ fill_in_info (ESelectNamesTableModel *model) static void clear_info (ESelectNamesTableModel *model) { - int i; - for (i = 0; i < model->count; i++) { - g_free(model->data[i].name); - g_free(model->data[i].email); + if (model->data) { + int i; + for (i = 0; i < model->count; i++) { + g_free(model->data[i].name); + g_free(model->data[i].email); + } + g_free(model->data); + model->data = NULL; + model->count = -1; } - g_free(model->data); - model->data = NULL; - model->count = -1; } /* @@ -168,6 +171,9 @@ e_select_names_table_model_dispose (GObject *object) e_select_names_table_model_drop_source (model); clear_info(model); + + if (G_OBJECT_CLASS (parent_class)->dispose) + G_OBJECT_CLASS (parent_class)->dispose (object); } /* This function returns the number of columns in our ETableModel. */ @@ -332,6 +338,8 @@ e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass) object_class = G_OBJECT_CLASS(klass); table_model_class = E_TABLE_MODEL_CLASS(klass); + parent_class = g_type_class_peek_parent (klass); + object_class->dispose = e_select_names_table_model_dispose; object_class->get_property = e_select_names_table_model_get_property; object_class->set_property = e_select_names_table_model_set_property; |