diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-06-28 12:20:22 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-06-28 12:20:22 +0000 |
commit | 5381b42bad8709a73f33a4e283d4e6c9010df944 (patch) | |
tree | cf6940fc4387b47a22d74d0fbe8a7c91d0568502 | |
parent | 5b49b797ecb2f9cca56acd5a36d98ae46910bb3e (diff) | |
download | nautilus-5381b42bad8709a73f33a4e283d4e6c9010df944.tar.gz |
Stop loading of new view instead of just unreffing it when freeing a
2008-06-28 Christian Neumair <cneumair@gnome.org>
* src/nautilus-window-manage-views.c
(nautilus_window_report_selection_changed),
(nautilus_window_report_load_underway),
(nautilus_window_report_load_complete), (free_location_change),
(nautilus_window_report_view_failed),
(nautilus_window_stop_loading):
* src/nautilus-window-private.h:
Stop loading of new view instead of just unreffing it when freeing a
location change.
Ignore view signals of new view when stopping it. Otherwise we'd have
infinite recursion.
svn path=/trunk/; revision=14287
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | src/nautilus-window-manage-views.c | 24 | ||||
-rw-r--r-- | src/nautilus-window-private.h | 6 |
3 files changed, 43 insertions, 1 deletions
@@ -1,5 +1,19 @@ 2008-06-28 Christian Neumair <cneumair@gnome.org> + * src/nautilus-window-manage-views.c + (nautilus_window_report_selection_changed), + (nautilus_window_report_load_underway), + (nautilus_window_report_load_complete), (free_location_change), + (nautilus_window_report_view_failed), + (nautilus_window_stop_loading): + * src/nautilus-window-private.h: + Stop loading of new view instead of just unreffing it when freeing a + location change. + Ignore view signals of new view when stopping it. Otherwise we'd have + infinite recursion. + +2008-06-28 Christian Neumair <cneumair@gnome.org> + * libnautilus-private/nautilus-icon-container.c (keyboard_move_to), (keyboard_space): If no icon is selected, but an icon has the keyboard focus, select it diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index 7e815f551..078e1ea8c 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -114,6 +114,10 @@ static void remove_extra_location_widgets (NautilusWindow void nautilus_window_report_selection_changed (NautilusWindowInfo *window) { + if (window->details->temporarily_ignore_view_signals) { + return; + } + g_signal_emit_by_name (window, "selection_changed"); } @@ -1212,6 +1216,10 @@ void nautilus_window_report_load_underway (NautilusWindow *window, NautilusView *view) { + if (window->details->temporarily_ignore_view_signals) { + return; + } + g_assert (NAUTILUS_IS_WINDOW (window)); if (view == window->new_content_view) { @@ -1511,6 +1519,10 @@ void nautilus_window_report_load_complete (NautilusWindow *window, NautilusView *view) { + if (window->details->temporarily_ignore_view_signals) { + return; + } + g_assert (NAUTILUS_IS_WINDOW (window)); /* Only handle this if we're expecting it. @@ -1575,6 +1587,10 @@ free_location_change (NautilusWindow *window) } if (window->new_content_view != NULL) { + window->details->temporarily_ignore_view_signals = TRUE; + nautilus_view_stop_loading (window->new_content_view); + window->details->temporarily_ignore_view_signals = FALSE; + disconnect_view (window, window->new_content_view); g_object_unref (window->new_content_view); window->new_content_view = NULL; @@ -1613,8 +1629,12 @@ nautilus_window_report_view_failed (NautilusWindow *window, { gboolean do_close_window; GFile *fallback_load_location; - g_warning ("A view failed. The UI will handle this with a dialog but this should be debugged."); + if (window->details->temporarily_ignore_view_signals) { + return; + } + + g_warning ("A view failed. The UI will handle this with a dialog but this should be debugged."); do_close_window = FALSE; fallback_load_location = NULL; @@ -1761,7 +1781,9 @@ nautilus_window_stop_loading (NautilusWindow *window) nautilus_view_stop_loading (window->content_view); if (window->new_content_view != NULL) { + window->details->temporarily_ignore_view_signals = TRUE; nautilus_view_stop_loading (window->new_content_view); + window->details->temporarily_ignore_view_signals = FALSE; } cancel_location_change (window); diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h index 69eaac885..440cf35d8 100644 --- a/src/nautilus-window-private.h +++ b/src/nautilus-window-private.h @@ -103,6 +103,12 @@ struct NautilusWindowDetails gboolean search_mode; GCancellable *find_mount_cancellable; + + /* Ensures that we do not react on signals of a + * view that is re-used as new view when its loading + * is cancelled + */ + gboolean temporarily_ignore_view_signals; }; struct _NautilusNavigationWindowDetails { |