From acb73cd1058e5351a80408ba49975eb5ba73287a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 20 Aug 2010 20:03:21 +0100 Subject: Fix more non-removal of signals on user_data object distruction by using g_signal_connect_object in many places; fixes bgo#627525# --- modules/calendar/e-task-shell-view-private.c | 72 +++++++++---------- modules/mail/e-mail-shell-view-private.c | 104 +++++++++++++-------------- 2 files changed, 88 insertions(+), 88 deletions(-) (limited to 'modules') diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 291f967015..e5cf75711c 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -246,80 +246,80 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_sidebar = E_TASK_SHELL_SIDEBAR (shell_sidebar); selector = e_task_shell_sidebar_get_selector (task_shell_sidebar); - g_signal_connect_swapped ( + g_signal_connect_object ( model, "notify::timezone", G_CALLBACK (e_task_shell_view_update_timezone), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( model, "row-appended", G_CALLBACK (task_shell_view_model_row_appended_cb), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_table, "open-component", G_CALLBACK (e_task_shell_view_open_task), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_table, "popup-event", G_CALLBACK (task_shell_view_table_popup_event_cb), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_table, "selection-change", G_CALLBACK (e_task_shell_view_update_sidebar), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_table, "selection-change", G_CALLBACK (e_shell_view_update_actions), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_table, "status-message", G_CALLBACK (e_task_shell_view_set_status_message), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( model, "model-changed", G_CALLBACK (e_task_shell_view_update_sidebar), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( model, "model-rows-deleted", G_CALLBACK (e_task_shell_view_update_sidebar), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( model, "model-rows-inserted", G_CALLBACK (e_task_shell_view_update_sidebar), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_shell_sidebar, "client-added", G_CALLBACK (task_shell_view_selector_client_added_cb), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_shell_sidebar, "client-removed", G_CALLBACK (task_shell_view_selector_client_removed_cb), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( task_shell_sidebar, "status-message", G_CALLBACK (e_task_shell_view_set_status_message), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( selector, "popup-event", G_CALLBACK (task_shell_view_selector_popup_event_cb), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( selector, "primary-selection-changed", G_CALLBACK (e_shell_view_update_actions), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); e_categories_add_change_hook ( (GHookFunc) e_task_shell_view_update_search_filter, @@ -336,18 +336,18 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) model, "default-client"); /* Hide Completed Tasks (enable/units/value) */ - g_signal_connect_swapped ( + g_signal_connect_object ( shell_settings, "notify::cal-hide-completed-tasks", G_CALLBACK (task_shell_view_process_completed_tasks), - task_shell_view); - g_signal_connect_swapped ( + task_shell_view, G_CONNECT_SWAPPED); + g_signal_connect_object ( shell_settings, "notify::cal-hide-completed-tasks-units", G_CALLBACK (task_shell_view_process_completed_tasks), - task_shell_view); - g_signal_connect_swapped ( + task_shell_view, G_CONNECT_SWAPPED); + g_signal_connect_object ( shell_settings, "notify::cal-hide-completed-tasks-value", G_CALLBACK (task_shell_view_process_completed_tasks), - task_shell_view); + task_shell_view, G_CONNECT_SWAPPED); e_task_shell_view_actions_init (task_shell_view); e_task_shell_view_update_sidebar (task_shell_view); diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index d11322899d..b1fcc726f8 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -143,10 +143,10 @@ mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view, widget_path = "/mail-folder-popup"; menu = e_shell_view_show_popup_menu (shell_view, widget_path, event); - g_signal_connect_swapped ( + g_signal_connect_object ( menu, "selection-done", G_CALLBACK (mail_shell_view_folder_tree_selection_done_cb), - shell_view); + shell_view, G_CONNECT_SWAPPED); } static gboolean @@ -324,41 +324,41 @@ mail_shell_view_reader_changed_cb (EMailShellView *mail_shell_view, mail_shell_view_message_list_key_press_cb, NULL)) return; - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "key-press", G_CALLBACK (mail_shell_view_message_list_key_press_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "popup-menu", G_CALLBACK (mail_shell_view_message_list_popup_menu_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "right-click", G_CALLBACK (mail_shell_view_message_list_right_click_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "key-press-event", G_CALLBACK (mail_shell_view_key_press_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "popup-event", G_CALLBACK (mail_shell_view_popup_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_data ( + g_signal_connect_object ( web_view, "scroll", G_CALLBACK (mail_shell_view_scroll_cb), - mail_shell_view, (GClosureNotify) NULL, + mail_shell_view, G_CONNECT_AFTER | G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "status-message", G_CALLBACK (e_shell_taskbar_set_message), - shell_taskbar); + shell_taskbar, G_CONNECT_SWAPPED); } static void @@ -534,101 +534,101 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) web_view = em_format_html_get_web_view (formatter); - g_signal_connect_swapped ( + g_signal_connect_object ( folder_tree, "folder-selected", G_CALLBACK (mail_shell_view_folder_tree_selected_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( folder_tree, "key-press-event", G_CALLBACK (mail_shell_view_folder_tree_key_press_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( folder_tree, "popup-event", G_CALLBACK (mail_shell_view_folder_tree_popup_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "key-press", G_CALLBACK (mail_shell_view_message_list_key_press_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "popup-menu", G_CALLBACK (mail_shell_view_message_list_popup_menu_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( message_list, "right-click", G_CALLBACK (mail_shell_view_message_list_right_click_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( reader, "changed", G_CALLBACK (mail_shell_view_reader_changed_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( reader, "folder-loaded", G_CALLBACK (e_mail_shell_content_update_view_instance), - shell_content); + shell_content, G_CONNECT_SWAPPED); /* Use the same callback as "changed". */ - g_signal_connect_swapped ( + g_signal_connect_object ( reader, "folder-loaded", G_CALLBACK (mail_shell_view_reader_changed_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( reader, "folder-loaded", G_CALLBACK (e_mail_shell_view_restore_state), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( tree_model, "row-changed", G_CALLBACK (e_mail_shell_view_update_search_filter), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( tree_model, "row-deleted", G_CALLBACK (e_mail_shell_view_update_search_filter), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( tree_model, "row-inserted", G_CALLBACK (e_mail_shell_view_update_search_filter), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "key-press-event", G_CALLBACK (mail_shell_view_key_press_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "popup-event", G_CALLBACK (mail_shell_view_popup_event_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_data ( + g_signal_connect_object ( web_view, "scroll", G_CALLBACK (mail_shell_view_scroll_cb), - mail_shell_view, (GClosureNotify) NULL, + mail_shell_view, G_CONNECT_AFTER | G_CONNECT_SWAPPED); - g_signal_connect_swapped ( + g_signal_connect_object ( web_view, "status-message", G_CALLBACK (e_shell_taskbar_set_message), - shell_taskbar); + shell_taskbar, G_CONNECT_SWAPPED); /* Need to keep the handler ID so we can disconnect it in * dispose(). The shell outlives us and we don't want it * invoking callbacks on finalized shell views. */ priv->prepare_for_quit_handler_id = - g_signal_connect_swapped ( + g_signal_connect_object ( shell, "prepare-for-quit", G_CALLBACK (mail_shell_view_prepare_for_quit_cb), - mail_shell_view); + mail_shell_view, G_CONNECT_SWAPPED); e_mail_reader_init (reader); e_mail_shell_view_actions_init (mail_shell_view); -- cgit v1.2.3