Commit 5381b42b authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

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
parent 5b49b797
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> 2008-06-28 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-icon-container.c (keyboard_move_to), * libnautilus-private/nautilus-icon-container.c (keyboard_move_to),
......
...@@ -114,6 +114,10 @@ static void remove_extra_location_widgets (NautilusWindow ...@@ -114,6 +114,10 @@ static void remove_extra_location_widgets (NautilusWindow
void void
nautilus_window_report_selection_changed (NautilusWindowInfo *window) nautilus_window_report_selection_changed (NautilusWindowInfo *window)
{ {
if (window->details->temporarily_ignore_view_signals) {
return;
}
g_signal_emit_by_name (window, "selection_changed"); g_signal_emit_by_name (window, "selection_changed");
} }
...@@ -1212,6 +1216,10 @@ void ...@@ -1212,6 +1216,10 @@ void
nautilus_window_report_load_underway (NautilusWindow *window, nautilus_window_report_load_underway (NautilusWindow *window,
NautilusView *view) NautilusView *view)
{ {
if (window->details->temporarily_ignore_view_signals) {
return;
}
g_assert (NAUTILUS_IS_WINDOW (window)); g_assert (NAUTILUS_IS_WINDOW (window));
if (view == window->new_content_view) { if (view == window->new_content_view) {
...@@ -1511,6 +1519,10 @@ void ...@@ -1511,6 +1519,10 @@ void
nautilus_window_report_load_complete (NautilusWindow *window, nautilus_window_report_load_complete (NautilusWindow *window,
NautilusView *view) NautilusView *view)
{ {
if (window->details->temporarily_ignore_view_signals) {
return;
}
g_assert (NAUTILUS_IS_WINDOW (window)); g_assert (NAUTILUS_IS_WINDOW (window));
/* Only handle this if we're expecting it. /* Only handle this if we're expecting it.
...@@ -1575,6 +1587,10 @@ free_location_change (NautilusWindow *window) ...@@ -1575,6 +1587,10 @@ free_location_change (NautilusWindow *window)
} }
if (window->new_content_view != NULL) { 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); disconnect_view (window, window->new_content_view);
g_object_unref (window->new_content_view); g_object_unref (window->new_content_view);
window->new_content_view = NULL; window->new_content_view = NULL;
...@@ -1613,8 +1629,12 @@ nautilus_window_report_view_failed (NautilusWindow *window, ...@@ -1613,8 +1629,12 @@ nautilus_window_report_view_failed (NautilusWindow *window,
{ {
gboolean do_close_window; gboolean do_close_window;
GFile *fallback_load_location; 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; do_close_window = FALSE;
fallback_load_location = NULL; fallback_load_location = NULL;
...@@ -1761,7 +1781,9 @@ nautilus_window_stop_loading (NautilusWindow *window) ...@@ -1761,7 +1781,9 @@ nautilus_window_stop_loading (NautilusWindow *window)
nautilus_view_stop_loading (window->content_view); nautilus_view_stop_loading (window->content_view);
if (window->new_content_view != NULL) { if (window->new_content_view != NULL) {
window->details->temporarily_ignore_view_signals = TRUE;
nautilus_view_stop_loading (window->new_content_view); nautilus_view_stop_loading (window->new_content_view);
window->details->temporarily_ignore_view_signals = FALSE;
} }
cancel_location_change (window); cancel_location_change (window);
......
...@@ -103,6 +103,12 @@ struct NautilusWindowDetails ...@@ -103,6 +103,12 @@ struct NautilusWindowDetails
gboolean search_mode; gboolean search_mode;
GCancellable *find_mount_cancellable; 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 { struct _NautilusNavigationWindowDetails {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment