Commit 3334a313 authored by Alexander Schwinn's avatar Alexander Schwinn
Browse files

Fix missing folder in history when opened in new tab (Issue #594)

Fixes #594
parent 19e070eb
Pipeline #9612 passed with stage
in 14 seconds
...@@ -723,3 +723,20 @@ thunar_history_peek_forward (ThunarHistory *history) ...@@ -723,3 +723,20 @@ thunar_history_peek_forward (ThunarHistory *history)
return result; return result;
} }
/**
* thunar_history_add:
* @history : a #ThunarHistory
* @history : a #ThunarFile
*
* Manually adds the passed directory to the history
**/
void
thunar_history_add (ThunarHistory *history,
ThunarFile *directory)
{
thunar_history_set_current_directory (THUNAR_NAVIGATOR (history), directory);
}
...@@ -63,6 +63,8 @@ void thunar_history_action_forward (ThunarHistory *history) ...@@ -63,6 +63,8 @@ void thunar_history_action_forward (ThunarHistory *history)
void thunar_history_show_menu (ThunarHistory *history, void thunar_history_show_menu (ThunarHistory *history,
ThunarHistoryMenuType type, ThunarHistoryMenuType type,
GtkWidget *parent); GtkWidget *parent);
void thunar_history_add (ThunarHistory *history,
ThunarFile *directory);
G_END_DECLS; G_END_DECLS;
......
...@@ -2106,7 +2106,13 @@ thunar_window_notebook_insert_page (ThunarWindow *window, ...@@ -2106,7 +2106,13 @@ thunar_window_notebook_insert_page (ThunarWindow *window,
/* set the history of the view if a history is provided */ /* set the history of the view if a history is provided */
if (history != NULL) if (history != NULL)
thunar_standard_view_set_history (THUNAR_STANDARD_VIEW (view), history); {
/* history only is updated on 'change-directory' signal. */
/* For inserting a new tab, we need to update it manually */
thunar_history_add (history, directory);
thunar_standard_view_set_history (THUNAR_STANDARD_VIEW (view), history);
}
label_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); label_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
...@@ -2296,7 +2302,9 @@ thunar_window_notebook_add_new_tab (ThunarWindow *window, ...@@ -2296,7 +2302,9 @@ thunar_window_notebook_add_new_tab (ThunarWindow *window,
/* save the history of the current view */ /* save the history of the current view */
if (THUNAR_IS_STANDARD_VIEW (window->view)) if (THUNAR_IS_STANDARD_VIEW (window->view))
history = thunar_standard_view_copy_history (THUNAR_STANDARD_VIEW (window->view)); {
history = thunar_standard_view_copy_history (THUNAR_STANDARD_VIEW (window->view));
}
/* find the correct view type */ /* find the correct view type */
view_type = thunar_window_view_type_for_directory (window, directory); view_type = thunar_window_view_type_for_directory (window, directory);
......
Supports Markdown
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