FileManager: Only set ~/Desktop as model root path in desktop mode

Setting it as model root path in DirectoryView::setup_model() for
windowed mode as well would cause an issue with the following:

- "open ~/Desktop"
- "FileManager ~/Desktop"
- "Show in FileManager..." from Desktop context menu

When viewing the Desktop as the initial path it would be the same and
on_path_change wasn't called, leading to various widgets and window
properties not being updated.

Fixes #3772.
This commit is contained in:
Linus Groh 2020-10-15 23:37:07 +02:00 committed by Andreas Kling
parent ac98a48177
commit 20907780bd
Notes: sideshowbarker 2024-07-19 01:53:43 +09:00

View file

@ -158,7 +158,8 @@ const GUI::FileSystemModel::Node& DirectoryView::node(const GUI::ModelIndex& ind
void DirectoryView::setup_model()
{
m_model->set_root_path(Core::StandardPaths::desktop_directory());
if (is_desktop())
m_model->set_root_path(Core::StandardPaths::desktop_directory());
m_model->on_error = [this](int, const char* error_string) {
auto failed_path = m_model->root_path();