ClangCodeModel: Clean file paths resulting from "follow symbol"

Apparently, libclang can give us non-cleaned paths, which we never
noticed until ea215d612d.
We also restore the previous behavior of TextDocument::setFilePath() in
order to prevent similar regressions elsewhere.

Fixes: QTCREATORBUG-26561
Change-Id: I218ed29600e9fb6b299aa2ba0b9d1464f475c06b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2021-11-11 16:11:00 +01:00
parent 95e8afabba
commit 76d3ffa57a
2 changed files with 6 additions and 5 deletions

View File

@@ -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