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 bool deleteFile = removeFileDialog.isDeleteFileChecked();
|
||||||
|
|
||||||
const QMessageBox::StandardButton reply = QMessageBox::question(
|
if (!siblings.isEmpty()) {
|
||||||
Core::ICore::dialogParent(), tr("Remove More Files?"),
|
const QMessageBox::StandardButton reply = QMessageBox::question(
|
||||||
tr("Remove these files as well?\n %1")
|
Core::ICore::dialogParent(), tr("Remove More Files?"),
|
||||||
.arg(Utils::transform<QStringList>(siblings, [](const NodeAndPath &np) {
|
tr("Remove these files as well?\n %1")
|
||||||
return np.second.toFileInfo().fileName();
|
.arg(Utils::transform<QStringList>(siblings, [](const NodeAndPath &np) {
|
||||||
}).join("\n ")));
|
return np.second.toFileInfo().fileName();
|
||||||
if (reply == QMessageBox::Yes)
|
}).join("\n ")));
|
||||||
filesToRemove << siblings;
|
if (reply == QMessageBox::Yes)
|
||||||
|
filesToRemove << siblings;
|
||||||
|
}
|
||||||
|
|
||||||
for (const NodeAndPath &file : filesToRemove) {
|
for (const NodeAndPath &file : filesToRemove) {
|
||||||
// Nodes can become invalid if the project was re-parsed while the dialog was open
|
// Nodes can become invalid if the project was re-parsed while the dialog was open
|
||||||
|
|||||||
Reference in New Issue
Block a user