summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-11-23 18:05:46 +0100
committerhjk <hjk@qt.io>2022-11-28 14:02:05 +0000
commit196e73fa163ff463570e9ab0e28ac04b4df9c69a (patch)
tree053107c4dd998caed19ea1059127fe1dcfccca7c /src/plugins/cppeditor/cppmodelmanager.cpp
parentf68db427ef763b995f9e4fa3f1dbf2c9b90ad943 (diff)
downloadqt-creator-196e73fa163ff463570e9ab0e28ac04b4df9c69a.tar.gz
CppEditor: Convert AbstractEditorSupport interface to FilePath
Change-Id: I47439e154bc28d40e112b7eef46fa1f57a8b3fce Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/cppeditor/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cppeditor/cppmodelmanager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp
index 42798d3a00..a768af9073 100644
--- a/src/plugins/cppeditor/cppmodelmanager.cpp
+++ b/src/plugins/cppeditor/cppmodelmanager.cpp
@@ -1128,12 +1128,12 @@ BaseEditorDocumentProcessor *CppModelManager::cppEditorDocumentProcessor(const Q
void CppModelManager::registerCppEditorDocument(CppEditorDocumentHandle *editorDocument)
{
QTC_ASSERT(editorDocument, return);
- const QString filePath = editorDocument->filePath();
+ const FilePath filePath = editorDocument->filePath();
QTC_ASSERT(!filePath.isEmpty(), return);
QMutexLocker locker(&d->m_cppEditorDocumentsMutex);
- QTC_ASSERT(d->m_cppEditorDocuments.value(filePath, 0) == 0, return);
- d->m_cppEditorDocuments.insert(filePath, editorDocument);
+ QTC_ASSERT(d->m_cppEditorDocuments.value(filePath.toString(), 0) == 0, return);
+ d->m_cppEditorDocuments.insert(filePath.toString(), editorDocument);
}
void CppModelManager::unregisterCppEditorDocument(const QString &filePath)
@@ -1204,7 +1204,7 @@ WorkingCopy CppModelManager::buildWorkingCopyList()
}
for (AbstractEditorSupport *es : std::as_const(d->m_extraEditorSupports))
- workingCopy.insert(es->fileName(), es->contents(), es->revision());
+ workingCopy.insert(es->filePath(), es->contents(), es->revision());
// Add the project configuration file
QByteArray conf = codeModelConfiguration();
@@ -1922,21 +1922,22 @@ void CppModelManager::GC()
return;
// Collect files of opened editors and editor supports (e.g. ui code model)
- QStringList filesInEditorSupports;
+ FilePaths filesInEditorSupports;
const QList<CppEditorDocumentHandle *> editorDocuments = cppEditorDocuments();
for (const CppEditorDocumentHandle *editorDocument : editorDocuments)
filesInEditorSupports << editorDocument->filePath();
const QSet<AbstractEditorSupport *> abstractEditorSupportList = abstractEditorSupports();
for (AbstractEditorSupport *abstractEditorSupport : abstractEditorSupportList)
- filesInEditorSupports << abstractEditorSupport->fileName();
+ filesInEditorSupports << abstractEditorSupport->filePath();
Snapshot currentSnapshot = snapshot();
QSet<Utils::FilePath> reachableFiles;
// The configuration file is part of the project files, which is just fine.
// If single files are open, without any project, then there is no need to
// keep the configuration file around.
- FilePaths todo = transform(filesInEditorSupports + projectFiles(), &FilePath::fromString);
+ FilePaths todo = filesInEditorSupports;
+ todo += transform(projectFiles(), &FilePath::fromString);
// Collect all files that are reachable from the project files
while (!todo.isEmpty()) {