Commit 0c68cbba authored by Fawzi Mohamed's avatar Fawzi Mohamed
Browse files

ios: fix refactoring (adding to qrc) in the common case



Task-number:QTCREATORBUG-11548
Change-Id: I6224b8745bf87981f5b305328294437cc51a7e7f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 2326cf7d
......@@ -40,6 +40,9 @@
#include <qmljs/qmljsdocument.h>
#include <qmljs/qmljsutils.h>
#include <qmljstools/qmljsrefactoringchanges.h>
#include <projectexplorer/session.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/project.h>
#include <QCoreApplication>
#include <QDir>
......@@ -108,6 +111,16 @@ public:
if (!refactoring.createFile(newFileName, txt))
return;
if (path == QFileInfo(fileName()).path()) {
// hack for the common case, next version should use the wizard
ProjectExplorer::Node * oldFileNode = ProjectExplorer::SessionManager::nodeForFile(fileName());
if (oldFileNode) {
ProjectExplorer::FolderNode *containingFolder = oldFileNode->parentFolderNode();
if (containingFolder)
containingFolder->addFiles(QStringList(newFileName));
}
}
Core::IVersionControl *versionControl = Core::VcsManager::findVersionControlForDirectory(path);
if (versionControl
&& versionControl->supportsOperation(Core::IVersionControl::AddOperation)) {
......
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