DirectoryView: Don't push same path twice to history

When opening a path, check if it's the current one before pushing it
twice to the path history.
This commit is contained in:
angel 2020-04-19 18:21:02 +02:00 committed by Andreas Kling
parent 579975fd1e
commit 27091d05ee
Notes: sideshowbarker 2024-07-19 17:35:51 +09:00

View file

@ -206,6 +206,10 @@ void DirectoryView::add_path_to_history(const StringView& path)
void DirectoryView::open(const StringView& path)
{
if (model().root_path() == path) {
model().update();
return;
}
add_path_to_history(path);
model().set_root_path(path);
}