CppEditor: Switch to FilePath in IndexItem

... and fix fallout.

Change-Id: I45d27146806bdcb5ceb728b710eca51c7cd32ee2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-11-23 17:11:20 +01:00
parent dbdabf9c27
commit 038771051d
12 changed files with 34 additions and 44 deletions

View File

@@ -2071,17 +2071,17 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
indexItems << info;
Snapshot localForwardHeaders = forwardHeaders;
localForwardHeaders.insert(interface.snapshot().document(info->fileName()));
Utils::FilePaths headerAndItsForwardingHeaders;
headerAndItsForwardingHeaders << Utils::FilePath::fromString(info->fileName());
headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->fileName());
localForwardHeaders.insert(interface.snapshot().document(info->filePath()));
FilePaths headerAndItsForwardingHeaders;
headerAndItsForwardingHeaders << info->filePath();
headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->filePath());
for (const Utils::FilePath &header : std::as_const(headerAndItsForwardingHeaders)) {
for (const FilePath &header : std::as_const(headerAndItsForwardingHeaders)) {
const QString include = findShortestInclude(currentDocumentFilePath,
header.toString(),
headerPaths);
if (include.size() > 2) {
const QString headerFileName = Utils::FilePath::fromString(info->fileName()).fileName();
const QString headerFileName = info->filePath().fileName();
QTC_ASSERT(!headerFileName.isEmpty(), break);
int priority = 0;