forked from qt-creator/qt-creator
ProjectExplorer: Do not needlessly try to rename files
Task-number: QTCREATORBUG-15963 Change-Id: I925f7a69b0ae6a3e2eb5b8a7ceae1faccdfc5759 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -3236,6 +3236,9 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
|
|||||||
FolderNode *folderNode = node->parentFolderNode();
|
FolderNode *folderNode = node->parentFolderNode();
|
||||||
const QString projectFileName = folderNode->projectNode()->filePath().fileName();
|
const QString projectFileName = folderNode->projectNode()->filePath().fileName();
|
||||||
|
|
||||||
|
if (oldFilePath == newFilePath)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!folderNode->canRenameFile(oldFilePath, newFilePath)) {
|
if (!folderNode->canRenameFile(oldFilePath, newFilePath)) {
|
||||||
QTimer::singleShot(0, [oldFilePath, newFilePath, projectFileName] {
|
QTimer::singleShot(0, [oldFilePath, newFilePath, projectFileName] {
|
||||||
int res = QMessageBox::question(ICore::mainWindow(),
|
int res = QMessageBox::question(ICore::mainWindow(),
|
||||||
|
Reference in New Issue
Block a user