- fix: Remove multiple files in the project panel is not correctly handled.

This commit is contained in:
Roy Qu 2023-03-24 17:55:02 +08:00
parent 919ba31c32
commit d7293b48fc
2 changed files with 6 additions and 1 deletions

View File

@ -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: 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. - enhancement: Open Containing folder will auto select the file in windows file explore.
- fix: Class constructor & destructor is not correctly handled. - 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 Red Panda C++ Version 2.18

View File

@ -7006,6 +7006,7 @@ void MainWindow::on_actionRemove_from_project_triggered()
tr("Remove the file from disk?"), tr("Remove the file from disk?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes); QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes);
QList<PProjectUnit> units;
foreach (const QModelIndex& index, ui->projectView->selectionModel()->selectedIndexes()){ foreach (const QModelIndex& index, ui->projectView->selectionModel()->selectedIndexes()){
if (!index.isValid()) if (!index.isValid())
continue; continue;
@ -7015,8 +7016,11 @@ void MainWindow::on_actionRemove_from_project_triggered()
if (!folderNode) if (!folderNode)
continue; continue;
PProjectUnit unit = folderNode->pUnit.lock(); PProjectUnit unit = folderNode->pUnit.lock();
units.append(unit);
}
for(PProjectUnit& unit: units) {
mProject->removeUnit(unit, true, removeFile); mProject->removeUnit(unit, true, removeFile);
}; }
mClassBrowserModel.beginUpdate(); mClassBrowserModel.beginUpdate();
mClassBrowserModel.endUpdate(); mClassBrowserModel.endUpdate();
ui->projectView->selectionModel()->clearSelection(); ui->projectView->selectionModel()->clearSelection();