CPlusPlus: Proliferate FilePath use

The starts with CppDocument::filePath(), plus a bit of the fallout

This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.

Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).

There should be no difference for local operation with this patch.

Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-11-21 16:48:50 +01:00
parent 822e2a224a
commit fa1adf4d40
69 changed files with 351 additions and 313 deletions

View File

@@ -49,7 +49,7 @@ public:
const QDateTime &lastModified() const { return _lastModified; }
void setLastModified(const QDateTime &lastModified);
const QString &fileName() const { return _fileName; }
const Utils::FilePath &filePath() const { return _filePath; }
void appendMacro(const Macro &macro);
void addMacroUse(const Macro &macro,
@@ -125,13 +125,13 @@ public:
};
public:
DiagnosticMessage(int level, const QString &fileName,
DiagnosticMessage(int level, const Utils::FilePath &filePath,
int line, int column,
const QString &text,
int length = 0)
: _level(level),
_line(line),
_fileName(fileName),
_filePath(filePath),
_column(column),
_length(length),
_text(text)
@@ -149,8 +149,8 @@ public:
bool isFatal() const
{ return _level == Fatal; }
const QString &fileName() const
{ return _fileName; }
const Utils::FilePath &filePath() const
{ return _filePath; }
int line() const
{ return _line; }
@@ -170,7 +170,7 @@ public:
private:
int _level;
int _line;
QString _fileName;
Utils::FilePath _filePath;
int _column;
int _length;
QString _text;
@@ -334,7 +334,7 @@ public:
{ return static_cast<CheckMode>(_checkMode); }
private:
QString _fileName;
Utils::FilePath _filePath;
Control *_control;
TranslationUnit *_translationUnit;
Namespace *_globalNamespace;