diff --git a/src/plugins/clangcodemodel/clangfollowsymbol.cpp b/src/plugins/clangcodemodel/clangfollowsymbol.cpp index 87e336d5508..bb107285567 100644 --- a/src/plugins/clangcodemodel/clangfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangfollowsymbol.cpp @@ -155,9 +155,10 @@ static ::Utils::ProcessLinkCallback extendedCallback(::Utils::ProcessLinkCallbac // If globalFollowSymbol finds nothing follow to the declaration. return [original_callback = std::move(callback), result](const ::Utils::Link &link) { if (link.linkTextStart < 0 && result.isResultOnlyForFallBack) { - return original_callback(::Utils::Link(::Utils::FilePath::fromString(result.fileName), - result.startLine, - result.startColumn - 1)); + return original_callback(Utils::Link( + Utils::FilePath::fromString(result.fileName).cleanPath(), + result.startLine, + result.startColumn - 1)); } return original_callback(link); }; @@ -242,7 +243,7 @@ void ClangFollowSymbol::findLink(const CppEditor::CursorInEditor &data, symbolFinder, inNextSplit); } else { - callback(Link(Utils::FilePath::fromString(result.fileName), + callback(Link(Utils::FilePath::fromString(result.fileName).cleanPath(), result.startLine, result.startColumn - 1)); } diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index cee8e3cf314..9462b06b829 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -651,7 +651,7 @@ void TextDocument::setFilePath(const Utils::FilePath &newName) { if (newName == filePath()) return; - IDocument::setFilePath(newName.absoluteFilePath()); + IDocument::setFilePath(newName.absoluteFilePath().cleanPath()); } IDocument::ReloadBehavior TextDocument::reloadBehavior(ChangeTrigger state, ChangeType type) const