1
Fork 0
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:
Kesse Jones 2020-11-02 08:32:52 -03:00 committed by Andreas Kling
parent fb5ea8a212
commit 6861cb8a23

View file

@ -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",