diff options
| author | hjk <hjk@qt.io> | 2022-11-23 19:00:38 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2022-11-29 12:27:10 +0000 |
| commit | 83720540a1370ef455cf129beb3c30fe565e0b68 (patch) | |
| tree | 6efa64c52dc0c6cee8a733326a0f0bb00f7f8fb0 /src/plugins/cppeditor/cppmodelmanager.cpp | |
| parent | 9a32aae70678ad88a04174e0939be17326aaff11 (diff) | |
| download | qt-creator-83720540a1370ef455cf129beb3c30fe565e0b68.tar.gz | |
CppEditor: Convert parts of ModelManagerInterface to FilePath
Change-Id: If7503b6d6732e1735eb8d48ece6e80886d10c647
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppmodelmanager.cpp')
| -rw-r--r-- | src/plugins/cppeditor/cppmodelmanager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 8b27d02491..cce4594704 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -1111,16 +1111,16 @@ void CppModelManager::removeExtraEditorSupport(AbstractEditorSupport *editorSupp d->m_extraEditorSupports.remove(editorSupport); } -CppEditorDocumentHandle *CppModelManager::cppEditorDocument(const QString &filePath) const +CppEditorDocumentHandle *CppModelManager::cppEditorDocument(const FilePath &filePath) const { if (filePath.isEmpty()) return nullptr; QMutexLocker locker(&d->m_cppEditorDocumentsMutex); - return d->m_cppEditorDocuments.value(filePath, 0); + return d->m_cppEditorDocuments.value(filePath.toString(), 0); } -BaseEditorDocumentProcessor *CppModelManager::cppEditorDocumentProcessor(const QString &filePath) +BaseEditorDocumentProcessor *CppModelManager::cppEditorDocumentProcessor(const FilePath &filePath) { const auto document = instance()->cppEditorDocument(filePath); return document ? document->processor() : nullptr; @@ -1442,7 +1442,7 @@ void CppModelManager::updateCppEditorDocuments(bool projectsUpdated) const const QList<Core::IEditor *> editors = Core::EditorManager::visibleEditors(); for (Core::IEditor *editor: editors) { if (Core::IDocument *document = editor->document()) { - const QString filePath = document->filePath().toString(); + const FilePath filePath = document->filePath(); if (CppEditorDocumentHandle *theCppEditorDocument = cppEditorDocument(filePath)) { visibleCppEditorDocuments.insert(document); theCppEditorDocument->processor()->run(projectsUpdated); @@ -1455,7 +1455,7 @@ void CppModelManager::updateCppEditorDocuments(bool projectsUpdated) const = Utils::toSet(Core::DocumentModel::openedDocuments()); invisibleCppEditorDocuments.subtract(visibleCppEditorDocuments); for (Core::IDocument *document : std::as_const(invisibleCppEditorDocuments)) { - const QString filePath = document->filePath().toString(); + const FilePath filePath = document->filePath(); if (CppEditorDocumentHandle *theCppEditorDocument = cppEditorDocument(filePath)) { const CppEditorDocumentHandle::RefreshReason refreshReason = projectsUpdated ? CppEditorDocumentHandle::ProjectUpdate @@ -1708,7 +1708,7 @@ void CppModelManager::onCurrentEditorChanged(Core::IEditor *editor) if (!editor || !editor->document()) return; - const QString filePath = editor->document()->filePath().toString(); + const FilePath filePath = editor->document()->filePath(); if (CppEditorDocumentHandle *theCppEditorDocument = cppEditorDocument(filePath)) { const CppEditorDocumentHandle::RefreshReason refreshReason = theCppEditorDocument->refreshReason(); |
