CppEditor: Convert parts of ModelManagerInterface to FilePath

Change-Id: If7503b6d6732e1735eb8d48ece6e80886d10c647
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-23 19:00:38 +01:00
parent 9a32aae706
commit 83720540a1
27 changed files with 89 additions and 95 deletions

View File

@@ -40,7 +40,7 @@ using namespace Utils;
namespace ClangCodeModel {
namespace Internal {
ProjectPart::ConstPtr projectPartForFile(const QString &filePath)
ProjectPart::ConstPtr projectPartForFile(const FilePath &filePath)
{
if (const auto parser = CppEditor::BaseEditorDocumentParser::get(filePath))
return parser->projectPartInfo().projectPart;
@@ -197,15 +197,14 @@ GenerateCompilationDbResult generateCompilationDB(QList<ProjectInfo::ConstPtr> p
return GenerateCompilationDbResult(compileCommandsFile.fileName(), QString());
}
QString currentCppEditorDocumentFilePath()
FilePath currentCppEditorDocumentFilePath()
{
QString filePath;
FilePath filePath;
const auto currentEditor = Core::EditorManager::currentEditor();
if (currentEditor && CppEditor::CppModelManager::isCppEditor(currentEditor)) {
const auto currentDocument = currentEditor->document();
if (currentDocument)
filePath = currentDocument->filePath().toString();
if (const auto currentDocument = currentEditor->document())
filePath = currentDocument->filePath();
}
return filePath;