Commit 0e731404 authored by Cosimo Cecchi's avatar Cosimo Cecchi

all: assume all windows are navigation windows

parent b6b63e35
...@@ -717,21 +717,15 @@ nautilus_application_close_all_navigation_windows (NautilusApplication *self) ...@@ -717,21 +717,15 @@ nautilus_application_close_all_navigation_windows (NautilusApplication *self)
NautilusWindow *window; NautilusWindow *window;
window = NAUTILUS_WINDOW (l->data); window = NAUTILUS_WINDOW (l->data);
if (NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
gtk_widget_hide (GTK_WIDGET (window)); gtk_widget_hide (GTK_WIDGET (window));
} }
}
for (l = list_copy; l != NULL; l = l->next) { for (l = list_copy; l != NULL; l = l->next) {
NautilusWindow *window; NautilusWindow *window;
window = NAUTILUS_WINDOW (l->data); window = NAUTILUS_WINDOW (l->data);
if (NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
nautilus_window_close (window); nautilus_window_close (window);
} }
}
g_list_free (list_copy); g_list_free (list_copy);
} }
...@@ -791,8 +785,7 @@ another_navigation_window_already_showing (NautilusApplication *application, ...@@ -791,8 +785,7 @@ another_navigation_window_already_showing (NautilusApplication *application,
list = gtk_application_get_windows (GTK_APPLICATION (application)); list = gtk_application_get_windows (GTK_APPLICATION (application));
for (item = list; item != NULL; item = item->next) { for (item = list; item != NULL; item = item->next) {
if (item->data != the_window && if (item->data != the_window) {
NAUTILUS_IS_NAVIGATION_WINDOW (item->data)) {
return TRUE; return TRUE;
} }
} }
......
...@@ -63,7 +63,6 @@ static int button_pressed_signal_id; ...@@ -63,7 +63,6 @@ static int button_pressed_signal_id;
static int key_pressed_signal_id; static int key_pressed_signal_id;
static int jump_button_signal_id; static int jump_button_signal_id;
static NautilusApplication *application; static NautilusApplication *application;
static gboolean parent_is_browser_window;
/* forward declarations */ /* forward declarations */
static guint get_selected_row (void); static guint get_selected_row (void);
...@@ -266,12 +265,6 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc ...@@ -266,12 +265,6 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
application = nautilus_application_dup_singleton (); application = nautilus_application_dup_singleton ();
if (NAUTILUS_IS_NAVIGATION_WINDOW (undo_manager_source)) {
parent_is_browser_window = TRUE;
} else {
parent_is_browser_window = FALSE;
}
set_up_close_accelerator (window); set_up_close_accelerator (window);
nautilus_undo_share_undo_manager (G_OBJECT (window), undo_manager_source); nautilus_undo_share_undo_manager (G_OBJECT (window), undo_manager_source);
......
...@@ -324,6 +324,9 @@ viewed_file_changed_callback (NautilusFile *file, ...@@ -324,6 +324,9 @@ viewed_file_changed_callback (NautilusFile *file,
* file was never seen in the first place. * file was never seen in the first place.
*/ */
if (slot->viewed_file_seen) { if (slot->viewed_file_seen) {
/* auto-show existing parent. */
GFile *go_to_file, *parent, *location;
/* Detecting a file is gone may happen in the /* Detecting a file is gone may happen in the
* middle of a pending location change, we * middle of a pending location change, we
* need to cancel it before closing the window * need to cancel it before closing the window
...@@ -339,10 +342,6 @@ viewed_file_changed_callback (NautilusFile *file, ...@@ -339,10 +342,6 @@ viewed_file_changed_callback (NautilusFile *file,
*/ */
end_location_change (slot); end_location_change (slot);
if (NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
/* auto-show existing parent. */
GFile *go_to_file, *parent, *location;
go_to_file = NULL; go_to_file = NULL;
location = nautilus_file_get_location (file); location = nautilus_file_get_location (file);
parent = g_file_get_parent (location); parent = g_file_get_parent (location);
...@@ -368,9 +367,6 @@ viewed_file_changed_callback (NautilusFile *file, ...@@ -368,9 +367,6 @@ viewed_file_changed_callback (NautilusFile *file,
} else { } else {
nautilus_window_slot_go_home (slot, FALSE); nautilus_window_slot_go_home (slot, FALSE);
} }
} else {
nautilus_window_close (window);
}
} }
} else { } else {
new_location = nautilus_file_get_location (file); new_location = nautilus_file_get_location (file);
...@@ -512,8 +508,7 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot, ...@@ -512,8 +508,7 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
g_assert (target_window != NULL); g_assert (target_window != NULL);
if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0 && if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0) {
NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
g_assert (target_window == window); g_assert (target_window == window);
slot_flags = 0; slot_flags = 0;
......
...@@ -177,9 +177,7 @@ nautilus_window_pane_slot_close (NautilusWindowPane *pane, ...@@ -177,9 +177,7 @@ nautilus_window_pane_slot_close (NautilusWindowPane *pane,
nautilus_window_close_pane (pane); nautilus_window_close_pane (pane);
nautilus_window_set_active_pane (window, next_pane); nautilus_window_set_active_pane (window, next_pane);
if (NAUTILUS_IS_NAVIGATION_WINDOW (window)) {
nautilus_navigation_window_update_show_hide_menu_items (NAUTILUS_NAVIGATION_WINDOW (window)); nautilus_navigation_window_update_show_hide_menu_items (NAUTILUS_NAVIGATION_WINDOW (window));
}
} else { } else {
nautilus_window_close (window); nautilus_window_close (window);
} }
......
...@@ -1443,7 +1443,6 @@ nautilus_forget_history (void) ...@@ -1443,7 +1443,6 @@ nautilus_forget_history (void)
window_node != NULL; window_node != NULL;
window_node = window_node->next) { window_node = window_node->next) {
if (NAUTILUS_IS_NAVIGATION_WINDOW (window_node->data)) {
NautilusNavigationWindow *window; NautilusNavigationWindow *window;
window = NAUTILUS_NAVIGATION_WINDOW (window_node->data); window = NAUTILUS_NAVIGATION_WINDOW (window_node->data);
...@@ -1461,7 +1460,6 @@ nautilus_forget_history (void) ...@@ -1461,7 +1460,6 @@ nautilus_forget_history (void)
nautilus_navigation_window_allow_back (window, FALSE); nautilus_navigation_window_allow_back (window, FALSE);
nautilus_navigation_window_allow_forward (window, FALSE); nautilus_navigation_window_allow_forward (window, FALSE);
} }
}
g_object_unref (app); g_object_unref (app);
} }
......
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