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/libs/3rdparty/cplusplus/Symbol.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/libs/3rdparty/cplusplus/Symbol.cpp') diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp index 01410ecea9..4ed2ab0c72 100644 --- a/src/libs/3rdparty/cplusplus/Symbol.cpp +++ b/src/libs/3rdparty/cplusplus/Symbol.cpp @@ -34,7 +34,9 @@ #include -using namespace CPlusPlus; +using namespace Utils; + +namespace CPlusPlus { class Symbol::HashCode: protected NameVisitor { @@ -166,6 +168,12 @@ const char *Symbol::fileName() const int Symbol::fileNameLength() const { return _fileId ? _fileId->size() : 0; } +Utils::FilePath Symbol::filePath() const +{ + return _fileId ? Utils::FilePath::fromUtf8(_fileId->chars(), _fileId->size()) + : Utils::FilePath(); +} + const Name *Symbol::unqualifiedName() const { if (! _name) @@ -280,10 +288,8 @@ void Symbol::copy(Symbol *other) _isDeprecated = other->_isDeprecated; } -Utils::Link Symbol::toLink() const +Link Symbol::toLink() const { - const QString filename = QString::fromUtf8(fileName(), fileNameLength()); - int line = this->line(); int column = this->column(); @@ -293,5 +299,7 @@ Utils::Link Symbol::toLink() const if (isGenerated()) column = 0; - return Utils::Link(Utils::FilePath::fromString(filename), line, column); + return Link(filePath(), line, column); } + +} // CPlusPlus -- cgit v1.2.1