forked from qt-creator/qt-creator
TextEditor: filepathify RefactoringChanges
Change-Id: Ie97e484bcdeaa0cb2f5d04b3c79ace55ff2e426c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -187,7 +187,8 @@ public:
|
||||
// stop if we can't create the new file
|
||||
const bool reindent = true;
|
||||
const bool openEditor = false;
|
||||
if (!refactoring.createFile(newFileName, newComponentSource, reindent, openEditor))
|
||||
const Utils::FilePath newFilePath = Utils::FilePath::fromString(newFileName);
|
||||
if (!refactoring.createFile(newFilePath, newComponentSource, reindent, openEditor))
|
||||
return;
|
||||
|
||||
if (path == QFileInfo(currentFileName).path()) {
|
||||
@@ -264,7 +265,7 @@ void performComponentFromObjectDef(const QString &fileName, QmlJS::AST::UiObject
|
||||
{
|
||||
QmlJSRefactoringChanges refactoring(QmlJS::ModelManagerInterface::instance(),
|
||||
QmlJS::ModelManagerInterface::instance()->snapshot());
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(fileName);
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(Utils::FilePath::fromString(fileName));
|
||||
|
||||
QmlJSQuickFixInterface interface;
|
||||
Operation operation(interface, objDef);
|
||||
|
||||
@@ -56,7 +56,7 @@ void QmlJSQuickFixOperation::perform()
|
||||
{
|
||||
QmlJSRefactoringChanges refactoring(ModelManagerInterface::instance(),
|
||||
m_interface->semanticInfo().snapshot);
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(fileName());
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(Utils::FilePath::fromString(fileName()));
|
||||
|
||||
performChanges(current, refactoring);
|
||||
}
|
||||
|
||||
@@ -880,7 +880,8 @@ void QmlOutlineModel::reparentNodes(QmlOutlineItem *targetItem, int row, QList<Q
|
||||
}
|
||||
|
||||
QmlJSRefactoringChanges refactoring(ModelManagerInterface::instance(), m_semanticInfo.snapshot);
|
||||
TextEditor::RefactoringFilePtr file = refactoring.file(m_semanticInfo.document->fileName());
|
||||
TextEditor::RefactoringFilePtr file = refactoring.file(
|
||||
Utils::FilePath::fromString(m_semanticInfo.document->fileName()));
|
||||
file->setChangeSet(changeSet);
|
||||
foreach (const Utils::ChangeSet::Range &range, changedRanges) {
|
||||
file->appendIndentRange(range);
|
||||
|
||||
Reference in New Issue
Block a user