forked from qt-creator/qt-creator
ios: fix refactoring (adding to qrc) in the common case
Task-number:QTCREATORBUG-11548 Change-Id: I6224b8745bf87981f5b305328294437cc51a7e7f Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user