From 4159c4b5d55c65d0759925e0dc8c63c60653b367 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 24 Nov 2022 15:21:15 +0100 Subject: CppEditor: More migration to FilePath Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff Reviewed-by: Christian Kandeler --- src/plugins/debugger/sourceutils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/debugger/sourceutils.cpp') diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp index ee912968f4..78d3b100f0 100644 --- a/src/plugins/debugger/sourceutils.cpp +++ b/src/plugins/debugger/sourceutils.cpp @@ -220,10 +220,10 @@ QStringList getUninitializedVariables(const Snapshot &snapshot, return result; } -QString cppFunctionAt(const QString &fileName, int line, int column) +QString cppFunctionAt(const FilePath &filePath, int line, int column) { const Snapshot snapshot = CppModelManager::instance()->snapshot(); - if (const Document::Ptr document = snapshot.document(fileName)) + if (const Document::Ptr document = snapshot.document(filePath)) return document->functionAt(line, column); return QString(); @@ -238,9 +238,9 @@ QString cppExpressionAt(TextEditorWidget *editorWidget, int pos, if (function) function->clear(); - const QString fileName = editorWidget->textDocument()->filePath().toString(); + const FilePath filePath = editorWidget->textDocument()->filePath(); const Snapshot snapshot = CppModelManager::instance()->snapshot(); - const Document::Ptr document = snapshot.document(fileName); + const Document::Ptr document = snapshot.document(filePath); QTextCursor tc = editorWidget->textCursor(); QString expr; if (tc.hasSelection() && pos >= tc.selectionStart() && pos <= tc.selectionEnd()) { @@ -374,7 +374,7 @@ static void setValueAnnotationsHelper(BaseTextEditor *textEditor, TextDocument *textDocument = widget->textDocument(); const FilePath filePath = loc.fileName(); const Snapshot snapshot = CppModelManager::instance()->snapshot(); - const Document::Ptr cppDocument = snapshot.document(filePath.toString()); + const Document::Ptr cppDocument = snapshot.document(filePath); if (!cppDocument) // For non-C++ documents. return; -- cgit v1.2.1