aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-12 01:08:13 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-12 01:08:13 +0800
commitc55ddc508dd4c9b558777f99604050f60b6158d3 (patch)
tree0c77bf97c02b135f557dca8747e3bebc3d7b32b6 /shell
parent8657f5bbf2ddd4a5118767643e0d3cc97d60f145 (diff)
downloadgsoc2013-evolution-c55ddc508dd4c9b558777f99604050f60b6158d3.tar.gz
gsoc2013-evolution-c55ddc508dd4c9b558777f99604050f60b6158d3.tar.zst
gsoc2013-evolution-c55ddc508dd4c9b558777f99604050f60b6158d3.zip
Make separate dispose/finalize overrides of just overriding destroy.
* e-component-registry.c: Make separate dispose/finalize overrides of just overriding destroy. * e-corba-config-page.c: Likewise. * e-corba-storage.c: Likewise. * e-folder-type-registry.c: Likewise. * e-folder.c: Likewise. * e-history.c: Likewise. * e-local-folder.c: Likewise. * e-local-storage.c: Likewise. * e-shell-folder-selection-dialog.c: Likewise. * e-shell-folder-title-bar.c: Likewise. * e-shell-offline-handler.c: Likewise. * e-shell-settings-dialog.c: Likewise. * e-shell-user-creatable-items-handler.c: Likewise. * e-shell-view.c: Likewise. * e-shortcuts-view-model.c: Likewise. * e-shortcuts-view.c: Likewise. * e-shortcuts.c: Likewise. * e-storage-set-view.c: Likewise. * e-storage-set.c: Likewise. * e-storage.c: Likewise. * e-task-bar.c: Likewise. * e-task-widget.c: Likewise. * e-uri-schema-registry.c: Likewise. * evolution-activity-client.c: Likewise. * evolution-folder-selector-button.c: Likewise. * evolution-storage-listener.c: Likewise. * evolution-storage-set-view-listener.c: Likewise. * evolution-test-component.c: Likewise. svn path=/trunk/; revision=18695
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog32
-rw-r--r--shell/e-component-registry.c33
-rw-r--r--shell/e-corba-config-page.c58
-rw-r--r--shell/e-corba-storage.c32
-rw-r--r--shell/e-folder-type-registry.c13
-rw-r--r--shell/e-folder.c12
-rw-r--r--shell/e-history.c10
-rw-r--r--shell/e-local-folder.c10
-rw-r--r--shell/e-local-storage.c39
-rw-r--r--shell/e-shell-folder-selection-dialog.c31
-rw-r--r--shell/e-shell-folder-title-bar.c30
-rw-r--r--shell/e-shell-offline-handler.c33
-rw-r--r--shell/e-shell-settings-dialog.c10
-rw-r--r--shell/e-shell-user-creatable-items-handler.c24
-rw-r--r--shell/e-shell-view.c68
-rw-r--r--shell/e-shortcuts-view-model.c13
-rw-r--r--shell/e-shortcuts-view.c30
-rw-r--r--shell/e-shortcuts.c35
-rw-r--r--shell/e-storage-set-view.c69
-rw-r--r--shell/e-storage-set.c36
-rw-r--r--shell/e-storage.c14
-rw-r--r--shell/e-task-bar.c17
-rw-r--r--shell/e-task-widget.c38
-rw-r--r--shell/e-uri-schema-registry.c8
-rw-r--r--shell/evolution-activity-client.c36
-rw-r--r--shell/evolution-folder-selector-button.c32
-rw-r--r--shell/evolution-storage-listener.c12
-rw-r--r--shell/evolution-storage-set-view-listener.c13
-rw-r--r--shell/evolution-test-component.c4
29 files changed, 538 insertions, 254 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index e117850839..0641fe6c09 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,35 @@
+2002-11-11 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-component-registry.c: Make separate dispose/finalize overrides
+ of just overriding destroy.
+ * e-corba-config-page.c: Likewise.
+ * e-corba-storage.c: Likewise.
+ * e-folder-type-registry.c: Likewise.
+ * e-folder.c: Likewise.
+ * e-history.c: Likewise.
+ * e-local-folder.c: Likewise.
+ * e-local-storage.c: Likewise.
+ * e-shell-folder-selection-dialog.c: Likewise.
+ * e-shell-folder-title-bar.c: Likewise.
+ * e-shell-offline-handler.c: Likewise.
+ * e-shell-settings-dialog.c: Likewise.
+ * e-shell-user-creatable-items-handler.c: Likewise.
+ * e-shell-view.c: Likewise.
+ * e-shortcuts-view-model.c: Likewise.
+ * e-shortcuts-view.c: Likewise.
+ * e-shortcuts.c: Likewise.
+ * e-storage-set-view.c: Likewise.
+ * e-storage-set.c: Likewise.
+ * e-storage.c: Likewise.
+ * e-task-bar.c: Likewise.
+ * e-task-widget.c: Likewise.
+ * e-uri-schema-registry.c: Likewise.
+ * evolution-activity-client.c: Likewise.
+ * evolution-folder-selector-button.c: Likewise.
+ * evolution-storage-listener.c: Likewise.
+ * evolution-storage-set-view-listener.c: Likewise.
+ * evolution-test-component.c: Likewise.
+
2002-11-08 Rodrigo Moya <rodrigo@ximian.com>
* importer/Makefile.am: use correctly IDL flags.
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 204546803e..448103c880 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -293,7 +293,7 @@ register_component (EComponentRegistry *component_registry,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
component_id_foreach_free (void *key,
@@ -307,7 +307,7 @@ component_id_foreach_free (void *key,
}
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EComponentRegistry *component_registry;
EComponentRegistryPrivate *priv;
@@ -315,23 +315,38 @@ destroy (GtkObject *object)
component_registry = E_COMPONENT_REGISTRY (object);
priv = component_registry->priv;
- g_hash_table_foreach (priv->component_id_to_component, component_id_foreach_free, NULL);
- g_hash_table_destroy (priv->component_id_to_component);
+ if (priv->component_id_to_component != NULL) {
+ g_hash_table_foreach (priv->component_id_to_component, component_id_foreach_free, NULL);
+ g_hash_table_destroy (priv->component_id_to_component);
+ priv->component_id_to_component = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EComponentRegistry *component_registry;
+ EComponentRegistryPrivate *priv;
+
+ component_registry = E_COMPONENT_REGISTRY (object);
+ priv = component_registry->priv;
g_free (priv);
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EComponentRegistryClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (gtk_object_get_type ());
}
diff --git a/shell/e-corba-config-page.c b/shell/e-corba-config-page.c
index d792e4db9b..e449c0149a 100644
--- a/shell/e-corba-config-page.c
+++ b/shell/e-corba-config-page.c
@@ -101,41 +101,54 @@ setup_listener (ECorbaConfigPage *corba_config_page,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
ECorbaConfigPage *corba_config_page;
ECorbaConfigPagePrivate *priv;
+ CORBA_Environment ev;
corba_config_page = E_CORBA_CONFIG_PAGE (object);
priv = corba_config_page->priv;
- if (priv != NULL) {
- CORBA_Environment ev;
+ CORBA_exception_init (&ev);
- CORBA_exception_init (&ev);
+ if (priv->config_control_interface != CORBA_OBJECT_NIL) {
+ bonobo_object_release_unref (priv->config_control_interface, &ev);
+ priv->config_control_interface = CORBA_OBJECT_NIL;
+ }
- if (priv->config_control_interface != CORBA_OBJECT_NIL)
- bonobo_object_release_unref (priv->config_control_interface, &ev);
+ if (priv->listener != NULL) {
+ Bonobo_EventSource_removeListener (priv->event_source,
+ bonobo_object_corba_objref (BONOBO_OBJECT (priv->listener)),
+ &ev);
- if (priv->listener != NULL) {
- Bonobo_EventSource_removeListener (priv->event_source,
- bonobo_object_corba_objref (BONOBO_OBJECT (priv->listener)),
- &ev);
- bonobo_object_unref (BONOBO_OBJECT (priv->listener));
+ bonobo_object_unref (BONOBO_OBJECT (priv->listener));
+ bonobo_object_release_unref (priv->event_source, &ev);
- bonobo_object_release_unref (priv->event_source, &ev);
- }
+ priv->event_source = CORBA_OBJECT_NIL;
+ priv->listener = NULL;
+ }
- CORBA_exception_free (&ev);
+ CORBA_exception_free (&ev);
- g_free (priv);
- corba_config_page->priv = NULL;
- }
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ ECorbaConfigPage *corba_config_page;
+ ECorbaConfigPagePrivate *priv;
+
+ corba_config_page = E_CORBA_CONFIG_PAGE (object);
+ priv = corba_config_page->priv;
+
+ g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -167,11 +180,12 @@ impl_apply (EConfigPage *config_page)
static void
class_init (ECorbaConfigPageClass *class)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
EConfigPageClass *config_page_class;
- object_class = GTK_OBJECT_CLASS (class);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
config_page_class = E_CONFIG_PAGE_CLASS (class);
config_page_class->apply = impl_apply;
diff --git a/shell/e-corba-storage.c b/shell/e-corba-storage.c
index 642eef2f80..dd50d168ea 100644
--- a/shell/e-corba-storage.c
+++ b/shell/e-corba-storage.c
@@ -236,10 +236,10 @@ setup_storage_listener (ECorbaStorage *corba_storage)
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
CORBA_Environment ev;
ECorbaStorage *corba_storage;
@@ -253,10 +253,13 @@ destroy (GtkObject *object)
if (priv->storage_interface != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (priv->storage_interface, &ev);
CORBA_Object_release (priv->storage_interface, &ev);
+ priv->storage_interface = CORBA_OBJECT_NIL;
}
- if (priv->storage_listener_interface != CORBA_OBJECT_NIL)
+ if (priv->storage_listener_interface != CORBA_OBJECT_NIL) {
CORBA_Object_release (priv->storage_listener_interface, &ev);
+ priv->storage_listener_interface = CORBA_OBJECT_NIL;
+ }
if (priv->storage_listener_servant != NULL) {
PortableServer_ObjectId *object_id;
@@ -267,15 +270,25 @@ destroy (GtkObject *object)
POA_GNOME_Evolution_StorageListener__fini (priv->storage_listener_servant, &ev);
CORBA_free (object_id);
+
+ priv->storage_listener_servant = NULL;
}
CORBA_exception_free (&ev);
- g_free (priv);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ ECorbaStorage *corba_storage;
+
+ corba_storage = E_CORBA_STORAGE (object);
- corba_storage->priv = NULL;
+ g_free (corba_storage->priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -655,11 +668,12 @@ corba_class_init (void)
static void
class_init (ECorbaStorageClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
EStorageClass *storage_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
storage_class = E_STORAGE_CLASS (klass);
storage_class->async_create_folder = async_create_folder;
diff --git a/shell/e-folder-type-registry.c b/shell/e-folder-type-registry.c
index c80f629af9..96e814faf9 100644
--- a/shell/e-folder-type-registry.c
+++ b/shell/e-folder-type-registry.c
@@ -223,7 +223,7 @@ hash_forall_free_folder_type (gpointer key,
}
static void
-destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EFolderTypeRegistry *folder_type_registry;
EFolderTypeRegistryPrivate *priv;
@@ -231,23 +231,22 @@ destroy (GtkObject *object)
folder_type_registry = E_FOLDER_TYPE_REGISTRY (object);
priv = folder_type_registry->priv;
- g_hash_table_foreach (priv->name_to_type,
- hash_forall_free_folder_type, NULL);
+ g_hash_table_foreach (priv->name_to_type, hash_forall_free_folder_type, NULL);
g_hash_table_destroy (priv->name_to_type);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EFolderTypeRegistryClass *class)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (class);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (gtk_object_get_type ());
}
diff --git a/shell/e-folder.c b/shell/e-folder.c
index 54a80bfc17..dc4d15f424 100644
--- a/shell/e-folder.c
+++ b/shell/e-folder.c
@@ -108,10 +108,10 @@ impl_get_physical_uri (EFolder *folder)
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EFolder *folder;
EFolderPrivate *priv;
@@ -128,19 +128,19 @@ destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EFolderClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (gtk_object_get_type ());
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->finalize = impl_finalize;
signals[CHANGED] = gtk_signal_new ("changed",
GTK_RUN_FIRST,
diff --git a/shell/e-history.c b/shell/e-history.c
index 78dfdabe51..b9424e0b5a 100644
--- a/shell/e-history.c
+++ b/shell/e-history.c
@@ -40,10 +40,10 @@ struct _EHistoryPrivate {
};
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EHistory *history;
EHistoryPrivate *priv;
@@ -59,16 +59,16 @@ impl_destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
-class_init (GtkObjectClass *object_class)
+class_init (GObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
- object_class->destroy = impl_destroy;
+ object_class->finalize = impl_finalize;
}
static void
diff --git a/shell/e-local-folder.c b/shell/e-local-folder.c
index ecbf61d018..4ba4466922 100644
--- a/shell/e-local-folder.c
+++ b/shell/e-local-folder.c
@@ -354,7 +354,7 @@ save_metadata (ELocalFolder *local_folder)
/* GtkObject methods. */
static void
-destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
ELocalFolder *local_folder;
ELocalFolderPrivate *priv;
@@ -369,19 +369,19 @@ destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (ELocalFolderClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (e_folder_get_type ());
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->finalize = impl_finalize;
setup_global_language_id ();
}
diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c
index c36863bf72..266cd22817 100644
--- a/shell/e-local-storage.c
+++ b/shell/e-local-storage.c
@@ -670,7 +670,7 @@ remove_folder (ELocalStorage *local_storage,
/* GtkObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
ELocalStorage *local_storage;
ELocalStoragePrivate *priv;
@@ -681,19 +681,34 @@ impl_destroy (GtkObject *object)
CORBA_exception_init (&ev);
- g_free (priv->base_path);
-
- if (priv->folder_type_registry != NULL)
+ if (priv->folder_type_registry != NULL) {
g_object_unref (priv->folder_type_registry);
+ priv->folder_type_registry = NULL;
+ }
- if (priv->bonobo_interface != NULL)
+ if (priv->bonobo_interface != NULL) {
bonobo_object_unref (BONOBO_OBJECT (priv->bonobo_interface));
-
- g_free (priv);
+ priv->bonobo_interface = NULL;
+ }
CORBA_exception_free (&ev);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ ELocalStorage *local_storage;
+ ELocalStoragePrivate *priv;
+
+ local_storage = E_LOCAL_STORAGE (object);
+ priv = local_storage->priv;
+
+ g_free (priv->base_path);
+ g_free (priv);
+
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -1056,13 +1071,15 @@ static void
class_init (ELocalStorageClass *class)
{
EStorageClass *storage_class;
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (e_storage_get_type ());
- object_class = GTK_OBJECT_CLASS (class);
+
+ object_class = G_OBJECT_CLASS (class);
storage_class = E_STORAGE_CLASS (class);
- object_class->destroy = impl_destroy;
+ object_class->finalize = impl_finalize;
+ object_class->dispose = impl_dispose;
storage_class->async_create_folder = impl_async_create_folder;
storage_class->async_remove_folder = impl_async_remove_folder;
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index e9e692bc6c..76e943a24c 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -175,7 +175,7 @@ save_expanded_state (EShellFolderSelectionDialog *folder_selection_dialog)
}
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShellFolderSelectionDialog *folder_selection_dialog;
EShellFolderSelectionDialogPrivate *priv;
@@ -183,16 +183,30 @@ impl_destroy (GtkObject *object)
folder_selection_dialog = E_SHELL_FOLDER_SELECTION_DIALOG (object);
priv = folder_selection_dialog->priv;
- save_expanded_state (folder_selection_dialog);
-
- if (priv->storage_set != NULL)
+ if (priv->storage_set != NULL) {
g_object_unref (priv->storage_set);
+ priv->storage_set = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShellFolderSelectionDialog *folder_selection_dialog;
+ EShellFolderSelectionDialogPrivate *priv;
+
+ folder_selection_dialog = E_SHELL_FOLDER_SELECTION_DIALOG (object);
+ priv = folder_selection_dialog->priv;
+
+ save_expanded_state (folder_selection_dialog);
e_free_string_list (priv->allowed_types);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -256,14 +270,15 @@ impl_response (GtkDialog *dialog,
static void
class_init (EShellFolderSelectionDialogClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkDialogClass *dialog_class;
parent_class = gtk_type_class (PARENT_TYPE);
- object_class = GTK_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
dialog_class = GTK_DIALOG_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
dialog_class->response = impl_response;
diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 7fa0aa73aa..154b393ac1 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -380,10 +380,10 @@ title_button_toggled_cb (GtkToggleButton *title_button,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShellFolderTitleBar *folder_title_bar;
EShellFolderTitleBarPrivate *priv;
@@ -391,11 +391,26 @@ impl_destroy (GtkObject *object)
folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (object);
priv = folder_title_bar->priv;
- if (priv->icon != NULL)
+ if (priv->icon != NULL) {
gdk_pixbuf_unref (priv->icon);
+ priv->icon = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShellFolderTitleBar *folder_title_bar;
+ EShellFolderTitleBarPrivate *priv;
+
+ folder_title_bar = E_SHELL_FOLDER_TITLE_BAR (object);
+ priv = folder_title_bar->priv;
+
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -443,11 +458,12 @@ impl_size_allocate (GtkWidget *widget,
static void
class_init (EShellFolderTitleBarClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = impl_size_allocate;
diff --git a/shell/e-shell-offline-handler.c b/shell/e-shell-offline-handler.c
index c743a41644..b38701ceeb 100644
--- a/shell/e-shell-offline-handler.c
+++ b/shell/e-shell-offline-handler.c
@@ -660,10 +660,10 @@ pop_up_confirmation_dialog (EShellOfflineHandler *offline_handler)
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShellOfflineHandler *offline_handler;
EShellOfflineHandlerPrivate *priv;
@@ -673,8 +673,11 @@ impl_destroy (GtkObject *object)
/* (We don't unref the shell, as it's our owner.) */
- g_hash_table_foreach (priv->id_to_component_info, hash_foreach_free_component_info, NULL);
- g_hash_table_destroy (priv->id_to_component_info);
+ if (priv->id_to_component_info != NULL) {
+ g_hash_table_foreach (priv->id_to_component_info, hash_foreach_free_component_info, NULL);
+ g_hash_table_destroy (priv->id_to_component_info);
+ priv->id_to_component_info = NULL;
+ }
if (priv->dialog_gui != NULL) {
GtkWidget *dialog;
@@ -686,10 +689,21 @@ impl_destroy (GtkObject *object)
priv->dialog_gui = NULL;
}
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShellOfflineHandler *offline_handler;
+ EShellOfflineHandlerPrivate *priv;
+
+ offline_handler = E_SHELL_OFFLINE_HANDLER (object);
+ priv = offline_handler->priv;
+
g_free (priv);
- if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -698,10 +712,11 @@ impl_destroy (GtkObject *object)
static void
class_init (EShellOfflineHandlerClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (gtk_object_get_type ());
diff --git a/shell/e-shell-settings-dialog.c b/shell/e-shell-settings-dialog.c
index 94eb75e2ce..55a2c74889 100644
--- a/shell/e-shell-settings-dialog.c
+++ b/shell/e-shell-settings-dialog.c
@@ -280,7 +280,7 @@ destroy_type_entry (gpointer key, gpointer value, gpointer data)
}
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EShellSettingsDialog *dialog;
EShellSettingsDialogPrivate *priv;
@@ -293,18 +293,18 @@ impl_destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EShellSettingsDialog *class)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = GTK_OBJECT_CLASS (class);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = impl_finalize;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->realize = impl_realize;
diff --git a/shell/e-shell-user-creatable-items-handler.c b/shell/e-shell-user-creatable-items-handler.c
index e68738007f..e7007b3103 100644
--- a/shell/e-shell-user-creatable-items-handler.c
+++ b/shell/e-shell-user-creatable-items-handler.c
@@ -656,10 +656,10 @@ shell_view_view_changed_callback (EShellView *shell_view,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShellUserCreatableItemsHandler *handler;
EShellUserCreatableItemsHandlerPrivate *priv;
@@ -672,21 +672,35 @@ impl_destroy (GtkObject *object)
component_free ((Component *) p->data);
g_slist_free (priv->components);
+ priv->components = NULL;
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShellUserCreatableItemsHandler *handler;
+ EShellUserCreatableItemsHandlerPrivate *priv;
+
+ handler = E_SHELL_USER_CREATABLE_ITEMS_HANDLER (object);
+ priv = handler->priv;
free_menu_items (priv->menu_items);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
-class_init (GtkObjectClass *object_class)
+class_init (GObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
- object_class->destroy = impl_destroy;
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
}
static void
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index bc5be0b5a9..836ce0c9bc 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1320,7 +1320,7 @@ setup_widgets (EShellView *shell_view)
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
hash_foreach_destroy_view (void *name,
@@ -1337,7 +1337,7 @@ hash_foreach_destroy_view (void *name,
}
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShellView *shell_view;
EShellViewPrivate *priv;
@@ -1350,19 +1350,30 @@ destroy (GtkObject *object)
storage set used for the delayed selection mechanism. */
cleanup_delayed_selection (shell_view);
- g_object_unref (priv->tooltips);
+ if (priv->tooltips != NULL) {
+ g_object_unref (priv->tooltips);
+ priv->tooltips = NULL;
+ }
- if (priv->history != NULL)
+ if (priv->history != NULL) {
g_object_unref (priv->history);
+ priv->history = NULL;
+ }
- if (priv->shell != NULL)
+ if (priv->shell != NULL) {
bonobo_object_unref (BONOBO_OBJECT (priv->shell));
+ priv->shell = NULL;
+ }
- if (priv->corba_interface != NULL)
+ if (priv->corba_interface != NULL) {
bonobo_object_unref (BONOBO_OBJECT (priv->corba_interface));
+ priv->corba_interface = NULL;
+ }
- if (priv->folder_bar_popup != NULL)
+ if (priv->folder_bar_popup != NULL) {
gtk_widget_destroy (priv->folder_bar_popup);
+ priv->folder_bar_popup = NULL;
+ }
for (p = priv->sockets; p != NULL; p = p->next) {
GtkWidget *socket_widget;
@@ -1373,24 +1384,44 @@ destroy (GtkObject *object)
"e_shell_view_destroy_connection_id"));
gtk_signal_disconnect (GTK_OBJECT (socket_widget), destroy_connection_id);
}
+ g_list_free (priv->sockets);
+ priv->sockets = NULL;
- g_hash_table_foreach (priv->uri_to_view, hash_foreach_destroy_view, NULL);
- g_hash_table_destroy (priv->uri_to_view);
-
- bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
+ if (priv->uri_to_view != NULL) {
+ g_hash_table_foreach (priv->uri_to_view, hash_foreach_destroy_view, NULL);
+ g_hash_table_destroy (priv->uri_to_view);
+ priv->uri_to_view = NULL;
+ }
- g_free (priv->uri);
+ if (priv->ui_component != NULL) {
+ bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
+ priv->ui_component = NULL;
+ }
- if (priv->set_folder_timeout != 0)
+ if (priv->set_folder_timeout != 0) {
gtk_timeout_remove (priv->set_folder_timeout);
+ priv->set_folder_timeout = 0;
+ }
- g_free (priv->set_folder_uri);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+static void
+impl_finalize (GObject *object)
+{
+ EShellView *shell_view;
+ EShellViewPrivate *priv;
+
+ shell_view = E_SHELL_VIEW (object);
+ priv = shell_view->priv;
+
+ g_free (priv->uri);
+ g_free (priv->set_folder_uri);
g_free (priv->delayed_selection);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -1399,11 +1430,12 @@ destroy (GtkObject *object)
static void
class_init (EShellViewClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = (GtkObjectClass *) klass;
+ object_class = G_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (BONOBO_TYPE_WINDOW);
diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c
index 7c7bc6bded..bdc0b60b06 100644
--- a/shell/e-shortcuts-view-model.c
+++ b/shell/e-shortcuts-view-model.c
@@ -256,10 +256,10 @@ shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EShortcutsViewModel *view_model;
EShortcutsViewModelPrivate *priv;
@@ -269,18 +269,17 @@ impl_destroy (GtkObject *object)
g_free (priv);
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EShortcutsViewModelClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (e_shortcut_model_get_type ());
}
diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c
index 0f4a8416de..6a2d911926 100644
--- a/shell/e-shortcuts-view.c
+++ b/shell/e-shortcuts-view.c
@@ -463,10 +463,10 @@ group_change_icon_size_callback (EShortcuts *shortucts,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShortcutsViewPrivate *priv;
EShortcutsView *shortcuts_view;
@@ -475,11 +475,24 @@ destroy (GtkObject *object)
priv = shortcuts_view->priv;
- g_object_unref (priv->shortcuts);
+ if (priv->shortcuts != NULL) {
+ g_object_unref (priv->shortcuts);
+ priv->shortcuts = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShortcutsView *shortcuts_view;
+
+ shortcuts_view = E_SHORTCUTS_VIEW (object);
- g_free (priv);
+ g_free (shortcuts_view->priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -677,11 +690,12 @@ impl_shortcut_drag_data_received (EShortcutBar *shortcut_bar,
static void
class_init (EShortcutsViewClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
EShortcutBarClass *shortcut_bar_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
shortcut_bar_class = E_SHORTCUT_BAR_CLASS (klass);
shortcut_bar_class->item_selected = item_selected;
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index c76a12cbd1..2561ce91bb 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -619,10 +619,10 @@ storage_set_updated_folder_callback (EStorageSet *storage_set,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EShortcuts *shortcuts;
EShortcutsPrivate *priv;
@@ -630,29 +630,46 @@ impl_destroy (GtkObject *object)
shortcuts = E_SHORTCUTS (object);
priv = shortcuts->priv;
- g_free (priv->file_name);
-
unload_shortcuts (shortcuts);
- if (priv->save_idle_id != 0)
+ if (priv->save_idle_id != 0) {
gtk_idle_remove (priv->save_idle_id);
+ priv->save_idle_id = 0;
+ }
if (priv->dirty) {
if (! e_shortcuts_save (shortcuts, NULL))
g_warning (_("Error saving shortcuts.")); /* FIXME */
+ priv->dirty = FALSE;
}
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EShortcuts *shortcuts;
+ EShortcutsPrivate *priv;
+
+ shortcuts = E_SHORTCUTS (object);
+ priv = shortcuts->priv;
+
+ g_free (priv->file_name);
+ g_free (priv);
+
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EShortcutsClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = (GtkObjectClass*) klass;
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (gtk_object_get_type ());
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 5a0f0d43ab..6e910b37ab 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -819,7 +819,7 @@ pixbuf_free_func (gpointer key, gpointer value, gpointer user_data)
}
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EStorageSetView *storage_set_view;
EStorageSetViewPrivate *priv;
@@ -827,25 +827,21 @@ impl_destroy (GtkObject *object)
storage_set_view = E_STORAGE_SET_VIEW (object);
priv = storage_set_view->priv;
- /* need to destroy our tree */
- e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), priv->root_node);
- g_object_unref (priv->etree_model);
-
- /* the data in the hash table was all freed by freeing the tree */
- g_hash_table_destroy (priv->path_to_etree_node);
-
- /* now free up all the type_names and pixbufs stored in the
- hash table and destroy the hash table itself */
- g_hash_table_foreach (priv->type_name_to_pixbuf, pixbuf_free_func, NULL);
- g_hash_table_destroy (priv->type_name_to_pixbuf);
+ if (priv->etree_model != NULL) {
+ /* Destroy the tree. */
+ e_tree_memory_node_remove (E_TREE_MEMORY(priv->etree_model), priv->root_node);
+ g_object_unref (priv->etree_model);
+ priv->etree_model = NULL;
- if (priv->checkboxes) {
- g_hash_table_foreach (priv->checkboxes, (GHFunc) g_free, NULL);
- g_hash_table_destroy (priv->checkboxes);
- priv->checkboxes = NULL;
+ /* (The data in the hash table was all freed by freeing the tree.) */
+ g_hash_table_destroy (priv->path_to_etree_node);
+ priv->path_to_etree_node = NULL;
}
- g_object_unref (priv->storage_set);
+ if (priv->storage_set != NULL) {
+ g_object_unref (priv->storage_set);
+ priv->storage_set = NULL;
+ }
if (priv->drag_corba_source_interface != CORBA_OBJECT_NIL) {
CORBA_Environment ev;
@@ -862,25 +858,45 @@ impl_destroy (GtkObject *object)
CORBA_Object_release (priv->drag_corba_source_interface, &ev);
CORBA_exception_free (&ev);
+
+ priv->drag_corba_source_interface = CORBA_OBJECT_NIL;
}
+ if (priv->ui_component != NULL)
+ bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
+
+ /* (No unreffing for priv->ui_container since we use a weakref.) */
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EStorageSetView *storage_set_view;
+ EStorageSetViewPrivate *priv;
+
+ storage_set_view = E_STORAGE_SET_VIEW (object);
+ priv = storage_set_view->priv;
+
+ g_hash_table_foreach (priv->type_name_to_pixbuf, pixbuf_free_func, NULL);
+ g_hash_table_destroy (priv->type_name_to_pixbuf);
+
+ g_hash_table_foreach (priv->checkboxes, (GHFunc) g_free, NULL);
+ g_hash_table_destroy (priv->checkboxes);
+
if (priv->drag_corba_source_context != NULL)
CORBA_free (priv->drag_corba_source_context);
if (priv->drag_corba_data != NULL)
CORBA_free (priv->drag_corba_data);
- if (priv->ui_component != NULL)
- bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
-
- /* (No unreffing for priv->ui_container since we use a weakref.) */
-
g_free (priv->selected_row_path);
g_free (priv->right_click_row_path);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -1765,13 +1781,14 @@ close_folder_cb (EStorageSet *storage_set,
static void
class_init (EStorageSetViewClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
ETreeClass *etree_class;
parent_class = gtk_type_class (PARENT_TYPE);
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
etree_class = E_TREE_CLASS (klass);
etree_class->right_click = impl_right_click;
diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c
index 163f98758d..3cc17d1bdb 100644
--- a/shell/e-storage-set.c
+++ b/shell/e-storage-set.c
@@ -336,7 +336,7 @@ signal_new_folder_for_all_folders_in_storage (EStorageSet *storage_set,
/* GtkObject methods. */
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EStorageSet *storage_set;
EStorageSetPrivate *priv;
@@ -344,29 +344,47 @@ destroy (GtkObject *object)
storage_set = E_STORAGE_SET (object);
priv = storage_set->priv;
- e_free_object_list (priv->storages);
+ if (priv->storages != NULL) {
+ e_free_object_list (priv->storages);
+ priv->storages = NULL;
+ }
+
+ if (priv->folder_type_registry != NULL) {
+ g_object_unref (priv->folder_type_registry);
+ priv->folder_type_registry = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EStorageSet *storage_set;
+ EStorageSetPrivate *priv;
- g_object_unref (priv->folder_type_registry);
+ storage_set = E_STORAGE_SET (object);
+ priv = storage_set->priv;
- g_hash_table_foreach (priv->name_to_named_storage,
- (GHFunc) name_to_named_storage_foreach_destroy, NULL);
+ g_hash_table_foreach (priv->name_to_named_storage, (GHFunc) name_to_named_storage_foreach_destroy, NULL);
g_hash_table_destroy (priv->name_to_named_storage);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EStorageSetClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (gtk_object_get_type ());
- object_class = GTK_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
- object_class->destroy = destroy;
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
signals[NEW_STORAGE] =
gtk_signal_new ("new_storage",
diff --git a/shell/e-storage.c b/shell/e-storage.c
index d8390346e7..713e0dad4e 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -130,7 +130,7 @@ folder_changed_cb (EFolder *folder,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
free_folder (gpointer path, gpointer folder, gpointer user_data)
@@ -140,7 +140,7 @@ free_folder (gpointer path, gpointer folder, gpointer user_data)
}
static void
-destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EStorage *storage;
EStoragePrivate *priv;
@@ -157,7 +157,9 @@ destroy (GtkObject *object)
g_free (priv->name);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ g_free (priv);
+
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -263,12 +265,12 @@ impl_async_remove_shared_folder (EStorage *storage,
static void
class_init (EStorageClass *class)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (class);
+ object_class = G_OBJECT_CLASS (class);
parent_class = gtk_type_class (gtk_object_get_type ());
- object_class->destroy = destroy;
+ object_class->finalize = impl_finalize;
class->get_subfolder_paths = impl_get_subfolder_paths;
class->get_folder = impl_get_folder;
diff --git a/shell/e-task-bar.c b/shell/e-task-bar.c
index 0df785fd10..64a9cebfe5 100644
--- a/shell/e-task-bar.c
+++ b/shell/e-task-bar.c
@@ -81,27 +81,10 @@ reduce_displayed_activities_per_component (ETaskBar *task_bar)
}
-/* GtkObject methods. */
-
-static void
-impl_destroy (GtkObject *object)
-{
- ETaskBar *task_bar;
-
- task_bar = E_TASK_BAR (object);
-
- /* Nothing to do here. */
-
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
-
-
static void
class_init (GtkObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
-
- object_class->destroy = impl_destroy;
}
static void
diff --git a/shell/e-task-widget.c b/shell/e-task-widget.c
index ce936a5b10..e37ddc1e34 100644
--- a/shell/e-task-widget.c
+++ b/shell/e-task-widget.c
@@ -53,38 +53,52 @@ struct _ETaskWidgetPrivate {
};
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
ETaskWidget *task_widget;
ETaskWidgetPrivate *priv;
task_widget = E_TASK_WIDGET (object);
- if (task_widget->priv) {
- priv = task_widget->priv;
-
- g_free (priv->component_id);
+ if (priv->tooltips != NULL) {
g_object_unref (priv->tooltips);
+ priv->tooltips = NULL;
+ }
+ if (priv->icon_pixbuf != NULL) {
gdk_pixbuf_unref (priv->icon_pixbuf);
-
- g_free (priv);
- task_widget->priv = NULL;
+ priv->icon_pixbuf = NULL;
}
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ ETaskWidget *task_widget;
+ ETaskWidgetPrivate *priv;
+
+ task_widget = E_TASK_WIDGET (object);
+ priv = task_widget->priv;
+
+ g_free (priv->component_id);
+ g_free (priv);
+
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
-class_init (GtkObjectClass *object_class)
+class_init (GObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
- object_class->destroy = impl_destroy;
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
}
static void
diff --git a/shell/e-uri-schema-registry.c b/shell/e-uri-schema-registry.c
index f288bf16f3..650efa2908 100644
--- a/shell/e-uri-schema-registry.c
+++ b/shell/e-uri-schema-registry.c
@@ -82,7 +82,7 @@ schema_to_handler_destroy_foreach_callback (void *key,
/* GtkObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EUriSchemaRegistry *registry;
EUriSchemaRegistryPrivate *priv;
@@ -94,16 +94,16 @@ impl_destroy (GtkObject *object)
g_hash_table_destroy (priv->schema_to_handler);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
-class_init (GtkObjectClass *object_class)
+class_init (GObjectClass *object_class)
{
parent_class = gtk_type_class (PARENT_TYPE);
- object_class->destroy = impl_destroy;
+ object_class->finalize = impl_finalize;
}
static void
diff --git a/shell/evolution-activity-client.c b/shell/evolution-activity-client.c
index 0e78e27cf6..0047091768 100644
--- a/shell/evolution-activity-client.c
+++ b/shell/evolution-activity-client.c
@@ -155,10 +155,10 @@ listener_callback (BonoboListener *listener,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_dispose (GObject *object)
{
EvolutionActivityClient *activity_client;
EvolutionActivityClientPrivate *priv;
@@ -167,8 +167,10 @@ impl_destroy (GtkObject *object)
activity_client = EVOLUTION_ACTIVITY_CLIENT (object);
priv = activity_client->priv;
- if (priv->next_update_timeout_id != 0)
+ if (priv->next_update_timeout_id != 0) {
g_source_remove (priv->next_update_timeout_id);
+ priv->next_update_timeout_id = 0;
+ }
CORBA_exception_init (&ev);
@@ -181,30 +183,46 @@ impl_destroy (GtkObject *object)
BONOBO_EX_REPOID (&ev));
CORBA_Object_release (priv->activity_interface, &ev);
+
+ priv->activity_interface = CORBA_OBJECT_NIL;
}
CORBA_exception_free (&ev);
- if (priv->listener != NULL)
+ if (priv->listener != NULL) {
bonobo_object_unref (BONOBO_OBJECT (priv->listener));
+ priv->listener = NULL;
+ }
- g_free (priv->new_information);
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
+{
+ EvolutionActivityClient *activity_client;
+ EvolutionActivityClientPrivate *priv;
+ activity_client = EVOLUTION_ACTIVITY_CLIENT (object);
+ priv = activity_client->priv;
+
+ g_free (priv->new_information);
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EvolutionActivityClientClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (PARENT_TYPE);
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
signals[SHOW_DETAILS]
= gtk_signal_new ("show_details",
diff --git a/shell/evolution-folder-selector-button.c b/shell/evolution-folder-selector-button.c
index a2d792e6f2..144e47afc2 100644
--- a/shell/evolution-folder-selector-button.c
+++ b/shell/evolution-folder-selector-button.c
@@ -194,10 +194,27 @@ clicked (GtkButton *button)
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-destroy (GtkObject *object)
+impl_dispose (GObject *object)
+{
+ EvolutionFolderSelectorButton *folder_selector_button;
+ EvolutionFolderSelectorButtonPrivate *priv;
+
+ folder_selector_button = EVOLUTION_FOLDER_SELECTOR_BUTTON (object);
+ priv = folder_selector_button->priv;
+
+ if (priv->shell_client != NULL) {
+ g_object_unref (priv->shell_client);
+ priv->shell_client = NULL;
+ }
+
+ (* G_OBJECT_CLASS (parent_class)->dispose) (object);
+}
+
+static void
+impl_finalize (GObject *object)
{
EvolutionFolderSelectorButton *folder_selector_button;
EvolutionFolderSelectorButtonPrivate *priv;
@@ -206,7 +223,6 @@ destroy (GtkObject *object)
folder_selector_button = EVOLUTION_FOLDER_SELECTOR_BUTTON (object);
priv = folder_selector_button->priv;
- g_object_unref (priv->shell_client);
g_free (priv->title);
for (i = 0; priv->possible_types[i]; i++)
g_free (priv->possible_types[i]);
@@ -217,23 +233,25 @@ destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
static void
class_init (EvolutionFolderSelectorButtonClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
GtkButtonClass *button_class;
parent_class = gtk_type_class (PARENT_TYPE);
- object_class = GTK_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
button_class = GTK_BUTTON_CLASS (klass);
button_class->clicked = clicked;
- object_class->destroy = destroy;
+
+ object_class->dispose = impl_dispose;
+ object_class->finalize = impl_finalize;
signals[POPPED_UP] = gtk_signal_new ("popped_up",
GTK_RUN_FIRST,
diff --git a/shell/evolution-storage-listener.c b/shell/evolution-storage-listener.c
index a0b82dc3c1..68dc9addac 100644
--- a/shell/evolution-storage-listener.c
+++ b/shell/evolution-storage-listener.c
@@ -187,10 +187,10 @@ activate_servant (EvolutionStorageListener *listener,
}
-/* GtkObject methods. */
+/* GObject methods. */
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EvolutionStorageListener *storage_listener;
EvolutionStorageListenerPrivate *priv;
@@ -218,7 +218,7 @@ impl_destroy (GtkObject *object)
g_free (priv);
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -249,12 +249,12 @@ corba_class_init (void)
static void
class_init (EvolutionStorageListenerClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
parent_class = gtk_type_class (PARENT_TYPE);
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->finalize = impl_finalize;
signals[DESTROYED] = gtk_signal_new ("destroyed",
GTK_RUN_FIRST,
diff --git a/shell/evolution-storage-set-view-listener.c b/shell/evolution-storage-set-view-listener.c
index 9d21f2c23b..e7a3a85556 100644
--- a/shell/evolution-storage-set-view-listener.c
+++ b/shell/evolution-storage-set-view-listener.c
@@ -134,8 +134,10 @@ activate_servant (EvolutionStorageSetViewListener *listener,
}
+/* GObject methods. */
+
static void
-impl_destroy (GtkObject *object)
+impl_finalize (GObject *object)
{
EvolutionStorageSetViewListener *listener;
EvolutionStorageSetViewListenerPrivate *priv;
@@ -163,8 +165,7 @@ impl_destroy (GtkObject *object)
g_free (priv);
- if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -192,10 +193,10 @@ corba_class_init (void)
static void
class_init (EvolutionStorageSetViewListenerClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = impl_destroy;
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->finalize = impl_finalize;
parent_class = gtk_type_class (gtk_object_get_type ());
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c
index 066251a364..0e96bad012 100644
--- a/shell/evolution-test-component.c
+++ b/shell/evolution-test-component.c
@@ -410,7 +410,7 @@ setup_custom_storage (EvolutionShellClient *shell_client)
FirstFolder so the order is reversed. */
evolution_storage_new_folder (the_storage, "/FirstFolder", "FirstFolder",
- "mail", "file:///tmp/blah", "", "inbox", 0, TRUE, 0);
+ "test", "file:///tmp/blah", "", "inbox", 0, TRUE, 0);
evolution_storage_new_folder (the_storage, "/SecondFolder", "SecondFolder",
"calendar", "file:///tmp/bleh", "", NULL, 0, FALSE, -1);
}
@@ -491,7 +491,7 @@ timeout_callback_1 (void *data)
#define NUM_ACTIVITIES 10
- animated_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGES "outbox-16.png", NULL);
+ animated_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGES "outbox-mini.png", NULL);
animated_icon[1] = NULL;
g_assert (animated_icon[0] != NULL);