summaryrefslogtreecommitdiff
path: root/src/libs/3rdparty/cplusplus/Symbol.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-11-24 15:21:15 +0100
committerhjk <hjk@qt.io>2022-12-14 09:14:12 +0000
commit4159c4b5d55c65d0759925e0dc8c63c60653b367 (patch)
treefbd8154d8317b25bcbb55bc715e2033cc412d30f /src/libs/3rdparty/cplusplus/Symbol.cpp
parent9bac0d7f4c574a88455771b88f078c0c10dd9b32 (diff)
downloadqt-creator-4159c4b5d55c65d0759925e0dc8c63c60653b367.tar.gz
CppEditor: More migration to FilePath
Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Symbol.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Symbol.cpp18
1 files changed, 13 insertions, 5 deletions
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 <utils/link.h>
-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