Commit 03ce1d80 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

ProjectExplorer: Report when file renaming fails



Report when file renaming fails at the filesystem level.

Change-Id: Ia3a1d6d8ec12013ae6fd0635c93498cad927b834
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>
parent 660bae3a
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>
#include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
...@@ -3340,6 +3341,16 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) ...@@ -3340,6 +3341,16 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
renameFileError); renameFileError);
}); });
} }
} else {
const QString renameFileError = tr("The file %1 could not be renamed %2.")
.arg(QDir::toNativeSeparators(orgFilePath))
.arg(QDir::toNativeSeparators(newFilePath));
QTimer::singleShot(0, [renameFileError]() {
QMessageBox::warning(ICore::mainWindow(),
tr("Cannot Rename File"),
renameFileError);
});
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment