Skip to content

Commit

Permalink
FileManager: Only set ~/Desktop as model root path in desktop mode
Browse files Browse the repository at this point in the history
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 SerenityOS#3772.
  • Loading branch information
linusg authored and awesomekling committed Oct 15, 2020
1 parent ac98a48 commit 2090778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Applications/FileManager/DirectoryView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2090778

Please sign in to comment.