1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

FileManager: Navigate to parent dir when current location is removed

When the location currently displayed in FileManager is removed, find
the nearest existing parent path and open it in the window.
Without the fix, the FileManager window remained in the deleted
directory.

Changing the path in 'DirectoryView' object will automatically update
other components in the FileManager (breadcrumb bar, directory tree
view).
This commit is contained in:
Adam Jakubek 2022-08-30 21:57:30 +02:00 committed by Sam Atkins
parent f7e6593910
commit aa466723eb
3 changed files with 15 additions and 0 deletions

View file

@ -421,6 +421,7 @@ void FileSystemModel::handle_file_event(Core::FileWatcherEvent const& event)
if (&child.value() == m_root) {
// Root directory of the filesystem model has been removed. All items became invalid.
invalidate();
on_root_path_removed();
break;
}