From c1b92fea69a1930ba5863a2f99ffe87b3422933d Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Date: Wed, 5 Nov 2014 22:42:05 +0200
Subject: [PATCH] QMakePM: Try to set current node even if rename fails

It always fails if the file is included by $$files(*), but the new
filename is expected to appear nevertheless.

Change-Id: I4ae102372685013182b4471b996610e68cb7f751
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
---
 src/plugins/qmakeprojectmanager/qmakenodes.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index de4d72c9823..23e1315e9d4 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -1107,6 +1107,8 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
     if (newFilePath.isEmpty())
         return false;
 
+    m_setCurrentNodeDelayed = newFilePath;
+
     bool changeProFileOptional = deploysFolder(QFileInfo(filePath).absolutePath());
     const Core::MimeType mt = Core::MimeDatabase::findByFile(newFilePath);
     QStringList dummy;
@@ -1117,7 +1119,6 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
     changeFiles(mt.type(), QStringList() << newFilePath, &dummy, AddToProFile);
     if (!dummy.isEmpty() && !changeProFileOptional)
         return false;
-    m_setCurrentNodeDelayed = newFilePath;
     return true;
 }
 
-- 
GitLab