summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2021-05-28 12:02:36 +0200
committerDavid Schulz <david.schulz@qt.io>2021-06-08 11:40:10 +0000
commit79b9a2fea613ba1746797f88845a37aba5387d12 (patch)
treef39a2010b0ec2a1b68c648f385649d7e25ad3bf3 /src/plugins/cppeditor/cppfunctiondecldeflink.cpp
parent15e4649fe8826c7405bddaf844169f072b2758ec (diff)
downloadqt-creator-79b9a2fea613ba1746797f88845a37aba5387d12.tar.gz
TextEditor: filepathify RefactoringChanges
Change-Id: Ie97e484bcdeaa0cb2f5d04b3c79ace55ff2e426c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppfunctiondecldeflink.cpp')
-rw-r--r--src/plugins/cppeditor/cppfunctiondecldeflink.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
index 7481778927..d127bace1e 100644
--- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
+++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
@@ -172,7 +172,8 @@ static QSharedPointer<FunctionDeclDefLink> findLinkHelper(QSharedPointer<Functio
// parse the target file to get the linked decl/def
const QString targetFileName = QString::fromUtf8(
target->fileName(), target->fileNameLength());
- CppRefactoringFileConstPtr targetFile = changes.fileNoEditor(targetFileName);
+ CppRefactoringFileConstPtr targetFile = changes.fileNoEditor(
+ Utils::FilePath::fromString(targetFileName));
if (!targetFile->isValid())
return noResult;
@@ -220,7 +221,8 @@ void FunctionDeclDefLinkFinder::startFindLinkAt(
// find the start/end offsets
CppRefactoringChanges refactoringChanges(snapshot);
- CppRefactoringFilePtr sourceFile = refactoringChanges.file(doc->fileName());
+ CppRefactoringFilePtr sourceFile = refactoringChanges.file(
+ Utils::FilePath::fromString(doc->fileName()));
sourceFile->setCppDocument(doc);
int start, end;
declDefLinkStartEnd(sourceFile, parent, funcDecl, &start, &end);
@@ -280,7 +282,7 @@ void FunctionDeclDefLink::apply(CppEditorWidget *editor, bool jumpToMatch)
// first verify the interesting region of the target file is unchanged
CppRefactoringChanges refactoringChanges(snapshot);
- CppRefactoringFilePtr newTargetFile = refactoringChanges.file(targetFile->fileName());
+ CppRefactoringFilePtr newTargetFile = refactoringChanges.file(targetFile->filePath());
if (!newTargetFile->isValid())
return;
const int targetStart = newTargetFile->position(targetLine, targetColumn);