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

@@ -10,6 +10,7 @@
#include "cpptoolsreuse.h"
#include <coreplugin/helpitem.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/quickfix.h>
#include <texteditor/texteditor.h>
@@ -18,7 +19,6 @@
#include <cplusplus/CppDocument.h>
#include <QTextEdit>
#include <QVariant>
#include <functional>
@@ -45,7 +45,7 @@ class CPPEDITOR_EXPORT BaseEditorDocumentProcessor : public QObject
Q_OBJECT
public:
BaseEditorDocumentProcessor(QTextDocument *textDocument, const QString &filePath);
BaseEditorDocumentProcessor(QTextDocument *textDocument, const Utils::FilePath &filePath);
~BaseEditorDocumentProcessor() override;
void run(bool projectsUpdated = false);
@@ -65,7 +65,7 @@ public:
virtual QFuture<CursorInfo> cursorInfo(const CursorInfoParams &params) = 0;
QString filePath() const { return m_filePath; }
const Utils::FilePath &filePath() const { return m_filePath; }
signals:
// Signal interface to implement
@@ -94,7 +94,7 @@ private:
virtual void runImpl(const BaseEditorDocumentParser::UpdateParams &updateParams) = 0;
private:
QString m_filePath;
Utils::FilePath m_filePath;
QTextDocument *m_textDocument;
};