From 9a86c2cbc0b1e75f9073461ead8bc2d917694921 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 21 Apr 2016 17:15:34 +0300 Subject: prefs dialog: don't crash on toggling "Show hidden and backup files" adapted from: https://git.gnome.org/browse/nautilus/commit/?id=7428762ea6601abba086fcc5e57f443b2e2b40b5 fixes https://github.com/mate-desktop/caja/issues/326 --- src/caja-window-menus.c | 25 ++++++++++++++----------- src/caja-window-private.h | 2 +- src/caja-window.c | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c index da442f59..4f1f0677 100644 --- a/src/caja-window-menus.c +++ b/src/caja-window-menus.c @@ -986,6 +986,20 @@ caja_window_initialize_menus (CajaWindow *window) caja_window_initialize_trash_icon_monitor (window); } +void +caja_window_finalize_menus (CajaWindow *window) +{ + CajaTrashMonitor *monitor; + + monitor = caja_trash_monitor_get (); + + g_signal_handlers_disconnect_by_func (monitor, + trash_state_changed_cb, window); + + g_signal_handlers_disconnect_by_func (caja_preferences, + show_hidden_files_preference_callback, window); +} + static GList * get_extension_menus (CajaWindow *window) { @@ -1123,14 +1137,3 @@ caja_window_load_extension_menus (CajaWindow *window) } } -void -caja_window_remove_trash_monitor_callback (CajaWindow *window) -{ - CajaTrashMonitor *monitor; - - monitor = caja_trash_monitor_get (); - - g_signal_handlers_disconnect_by_func (monitor, - trash_state_changed_cb, window); -} - diff --git a/src/caja-window-private.h b/src/caja-window-private.h index 73a9c29c..1147163f 100644 --- a/src/caja-window-private.h +++ b/src/caja-window-private.h @@ -168,7 +168,7 @@ void caja_window_set_status (CajaWindow void caja_window_load_view_as_menus (CajaWindow *window); void caja_window_load_extension_menus (CajaWindow *window); void caja_window_initialize_menus (CajaWindow *window); -void caja_window_remove_trash_monitor_callback (CajaWindow *window); +void caja_window_finalize_menus (CajaWindow *window); CajaWindowPane *caja_window_get_next_pane (CajaWindow *window); void caja_menus_append_bookmark_to_menu (CajaWindow *window, CajaBookmark *bookmark, diff --git a/src/caja-window.c b/src/caja-window.c index 03a01032..1eca5977 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -682,7 +682,7 @@ caja_window_finalize (GObject *object) window = CAJA_WINDOW (object); - caja_window_remove_trash_monitor_callback (window); + caja_window_finalize_menus (window); free_stored_viewers (window); if (window->details->bookmark_list != NULL) -- cgit v1.2.1