aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-15 04:32:46 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-15 04:32:46 +0800
commit4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b (patch)
tree403ba09391610f38fcacb7af6d85fbc8355e5717 /shell/e-shell.c
parentc2effba7cf78ed636248da4c45ceefc2df52261b (diff)
downloadgsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar.gz
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar.bz2
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar.lz
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar.xz
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.tar.zst
gsoc2013-evolution-4f5782221ff72c0f9bf2066fe88aadadfb9c0c5b.zip
Removed. (no_views_left_cb): Use g_object_add_weak_pointer() instad of
* main.c (quit_box_destroyed_callback): Removed. (no_views_left_cb): Use g_object_add_weak_pointer() instad of connecting to the "destroy" signal. (destroy_cb): Removed. (shell_weak_notify): New. (idle_cb): Use g_object_weak_ref() on the shell object instead of connecting to the "destroy" signal. * evolution-test-component.c (dialog_destroy_callback): Removed. (dialog_weak_notify): New. (create_new_folder_selector): Use g_object_weak_ref() on the dialog instead of connecting the "destroy" signal. * e-shortcuts.c (view_destroyed_cb): Removed. (view_weak_notify): New. (e_shortcuts_new_view): g_object_weak_ref() the new view instead of connecting the "destroy" signal. (impl_dispose): Free the ->views and g_object_weak_unref() all the items. * e-shell.c (view_destroy_cb): Removed. (view_weak_notify): New. (create_view): Use g_object_weak_ref() on the newly created view instead of connecting to the "destroy" signal. (impl_dispose): g_object_weak_unref() the views. (e_shell_show_settings): Use g_object_add_weak_pointer() on the settings_dialog instead of connecting to the "destroy" signal. (settings_dialog_destroy_cb): Removed. * e-shell-shared-folder-picker-dialog.c (progress_bar_weak_notify): New. (progress_bar_destroy_callback): Removed. (create_progress_dialog): Use g_object_weak_ref() on the progress bar object instead of connecting to its "destroy" signal. (shell_destroy_callback): Removed. (shell_view_destroy_callback): Removed. (storage_destroy_callback): Removed. (shell_weak_notify): New. (shell_view_weak_notify): New. (storage_weak_notify): New. (discover_folder): Use g_object_weak_ref() on the shell, parent, storage objects instead of connecting to their "destroy" signals. * e-shell-importer.c: Removed member destroyed from ImporterComponentData. (import_cb): Instead of checking if ->destroyed is TRUE, check if ->dialog is NULL to decide whether the dialog has been destroyed or not. (dialog_destroy_cb): Removed. (start_import): Use g_object_weak_ref() on the dialog object instead of connecting to its "destroy" signal. (dialog_close): Removed. (dialog_weak_notify): New. (show_import_wizard): Use g_object_weak_ref() on the dialog object instead of connecting to its "destroy" signal. (import_druid_destroy): New. (import_druid_weak_notify): New. (show_import_wizard): Use g_object_weak_ref() on the druid object instead of connecting to its "destroy" signal. * e-shell-folder-selection-dialog.c (e_shell_folder_selection_dialog_construct): g_object_weak_ref() the shell object instead of connecting to its "destroy" signal. * e-shell-folder-creation-dialog.c (dialog_destroy_cb): Removed. (dialog_destroy_notify): New. (e_shell_show_folder_creation_dialog): g_object_weak_ref() the dialog instead of connecting to its "destroy" signal. (shell_destroy_cb): Removed. (shell_destroy_notify): New. (e_shell_show_folder_creation_dialog): g_object_weak_ref() the shell object instead of connecting to its "destroy" signal. * e-shell-config-offline.c (config_control_destroy_callback): Removed. (config_control_destroy_notify): New. (e_shell_config_offline_create_widget): g_object_weak_ref() the config_control instead of connecting to its "destroy" signal. * e-shell-config-default-folders.c (config_control_destroy_callback): Removed. (config_control_destroy_notify): New. (e_shell_config_default_folders_create_widget): g_object_weak_ref() instead of connecting to the "destroy" signal. * e-shell-config-autocompletion.c (config_control_destroy_notify): New. (config_control_destroy_callback): Removed. (e_shell_config_autocompletion_create_widget): g_object_weak_ref() instead of connecting to the "destroy" signal. * e-activity-handler.c (task_bar_destroy_cb): Removed. (task_bar_destroy_notify): New. (e_activity_handler_attach_task_bar): Weak_ref the task_bar using task_bar_destroy_notify. (impl_dispose): Weak_unref the task bars in priv->task_bars. svn path=/trunk/; revision=18756
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 42beaa9280..6ac6061970 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-shell.c
*
- * Copyright (C) 2000, 2001 Ximian, Inc.
+ * Copyright (C) 2000, 2001, 2002 Ximian, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -957,14 +957,12 @@ view_delete_event_cb (GtkWidget *widget,
}
static void
-view_destroy_cb (GtkObject *object,
- void *data)
+view_weak_notify (void *data,
+ GObject *where_the_object_was)
{
EShell *shell;
int num_views;
- g_assert (E_IS_SHELL_VIEW (object));
-
shell = E_SHELL (data);
num_views = g_list_length (shell->priv->views);
@@ -975,7 +973,7 @@ view_destroy_cb (GtkObject *object,
if (num_views - 1 == 0)
e_shell_save_settings (shell);
- shell->priv->views = g_list_remove (shell->priv->views, object);
+ shell->priv->views = g_list_remove (shell->priv->views, where_the_object_was);
if (shell->priv->views == NULL) {
set_interactive (shell, FALSE);
@@ -1001,8 +999,8 @@ create_view (EShell *shell,
g_signal_connect (view, "delete_event",
G_CALLBACK (view_delete_event_cb), shell);
- g_signal_connect (view, "destroy",
- G_CALLBACK (view_destroy_cb), shell);
+
+ g_object_weak_ref (G_OBJECT (view), view_weak_notify, shell);
if (uri != NULL)
e_shell_view_display_uri (E_SHELL_VIEW (view), uri, TRUE);
@@ -1085,9 +1083,8 @@ impl_dispose (GObject *object)
gtk_signal_disconnect_by_func (GTK_OBJECT (view),
G_CALLBACK (view_delete_event_cb),
shell);
- gtk_signal_disconnect_by_func (GTK_OBJECT (view),
- G_CALLBACK (view_destroy_cb),
- shell);
+
+ g_object_weak_unref (G_OBJECT (view), view_weak_notify, shell);
gtk_object_destroy (GTK_OBJECT (view));
}
@@ -2079,18 +2076,6 @@ e_shell_send_receive (EShell *shell)
e_free_string_list (id_list);
}
-static void
-settings_dialog_destroy_cb (GtkWidget *widget, void *data)
-{
- EShell *shell;
- EShellPrivate *priv;
-
- shell = E_SHELL (data);
- priv = shell->priv;
-
- priv->settings_dialog = NULL;
-}
-
void
e_shell_show_settings (EShell *shell, const char *type, EShellView *shell_view)
{
@@ -2112,8 +2097,7 @@ e_shell_show_settings (EShell *shell, const char *type, EShellView *shell_view)
if (type != NULL)
e_shell_settings_dialog_show_type (E_SHELL_SETTINGS_DIALOG (priv->settings_dialog), type);
- g_signal_connect (priv->settings_dialog, "destroy",
- G_CALLBACK (settings_dialog_destroy_cb), shell);
+ g_object_add_weak_pointer (G_OBJECT (priv->settings_dialog), (void **) & priv->settings_dialog);
gtk_widget_show (priv->settings_dialog);
}