mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 13:35:07 +00:00
HackStudio: Removes the file from the list of open files
When a file is deleted from the project it will also be removed from the list of open files
This commit is contained in:
parent
fb5ea8a212
commit
6861cb8a23
1 changed files with 6 additions and 1 deletions
|
@ -351,7 +351,12 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
|
|||
return;
|
||||
|
||||
for (auto& file : files) {
|
||||
if (!m_project->remove_file(file)) {
|
||||
if (m_project->remove_file(file)) {
|
||||
m_open_files_vector.remove_first_matching([&](auto& filename) {
|
||||
return filename == file;
|
||||
});
|
||||
m_open_files_view->model()->update();
|
||||
} else {
|
||||
GUI::MessageBox::show(window(),
|
||||
String::formatted("Removing file {} from the project failed.", file),
|
||||
"Removal failed",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue