diff --git a/NEWS.md b/NEWS.md index 56f1db44..08619459 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ Red Panda C++ Version 2.19 - enhancement: Drag the selection beyond the end of the document, and move/copy it beyond the last line. - enhancement: Open Containing folder will auto select the file in windows file explore. - fix: Class constructor & destructor is not correctly handled. + - fix: Remove multiple files in the project panel is not correctly handled. Red Panda C++ Version 2.18 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 39c36cf6..60f05bda 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -7006,6 +7006,7 @@ void MainWindow::on_actionRemove_from_project_triggered() tr("Remove the file from disk?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes); + QList units; foreach (const QModelIndex& index, ui->projectView->selectionModel()->selectedIndexes()){ if (!index.isValid()) continue; @@ -7015,8 +7016,11 @@ void MainWindow::on_actionRemove_from_project_triggered() if (!folderNode) continue; PProjectUnit unit = folderNode->pUnit.lock(); + units.append(unit); + } + for(PProjectUnit& unit: units) { mProject->removeUnit(unit, true, removeFile); - }; + } mClassBrowserModel.beginUpdate(); mClassBrowserModel.endUpdate(); ui->projectView->selectionModel()->clearSelection();