diff options
author | hjk <hjk@qt.io> | 2022-11-24 15:21:15 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-12-14 09:14:12 +0000 |
commit | 4159c4b5d55c65d0759925e0dc8c63c60653b367 (patch) | |
tree | fbd8154d8317b25bcbb55bc715e2033cc412d30f /src/plugins/debugger/sourceutils.cpp | |
parent | 9bac0d7f4c574a88455771b88f078c0c10dd9b32 (diff) | |
download | qt-creator-4159c4b5d55c65d0759925e0dc8c63c60653b367.tar.gz |
CppEditor: More migration to FilePath
Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/debugger/sourceutils.cpp')
-rw-r--r-- | src/plugins/debugger/sourceutils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; |