forked from qt-creator/qt-creator
ProjectExplorer: Don't prompt user whether 0 files should be deleted
Change-Id: I893c8af5e2c0f0172dd397732275bdec9918bc44 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -3629,14 +3629,16 @@ void ProjectExplorerPluginPrivate::removeFile()
|
||||
|
||||
const bool deleteFile = removeFileDialog.isDeleteFileChecked();
|
||||
|
||||
const QMessageBox::StandardButton reply = QMessageBox::question(
|
||||
Core::ICore::dialogParent(), tr("Remove More Files?"),
|
||||
tr("Remove these files as well?\n %1")
|
||||
.arg(Utils::transform<QStringList>(siblings, [](const NodeAndPath &np) {
|
||||
return np.second.toFileInfo().fileName();
|
||||
}).join("\n ")));
|
||||
if (reply == QMessageBox::Yes)
|
||||
filesToRemove << siblings;
|
||||
if (!siblings.isEmpty()) {
|
||||
const QMessageBox::StandardButton reply = QMessageBox::question(
|
||||
Core::ICore::dialogParent(), tr("Remove More Files?"),
|
||||
tr("Remove these files as well?\n %1")
|
||||
.arg(Utils::transform<QStringList>(siblings, [](const NodeAndPath &np) {
|
||||
return np.second.toFileInfo().fileName();
|
||||
}).join("\n ")));
|
||||
if (reply == QMessageBox::Yes)
|
||||
filesToRemove << siblings;
|
||||
}
|
||||
|
||||
for (const NodeAndPath &file : filesToRemove) {
|
||||
// Nodes can become invalid if the project was re-parsed while the dialog was open
|
||||
|
||||
Reference in New Issue
Block a user