diff options
author | hjk <hjk@qt.io> | 2022-11-24 11:56:16 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-11-29 13:00:11 +0000 |
commit | 9dc5a9ec00ee361f936ae26bc3b226d47f10bf9c (patch) | |
tree | 5adf1f9c8db621b4c49bec88f934f55af87ddd7a /src/libs | |
parent | bb34f507dca677eef1169058144737e7f6936521 (diff) |
CPlusPlus: Code cosmetics
Rename a few 'fileName' into 'filePath'. Remove unneeded includes.
Change-Id: I850e06cb4f58ec8dc70aa389f2521be8f5247b5c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 18 | ||||
-rw-r--r-- | src/libs/cplusplus/CppDocument.h | 14 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 7a92e7ef95..5167e9ad2c 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -24,10 +24,8 @@ #include <utils/algorithm.h> -#include <QBitArray> #include <QByteArray> #include <QDebug> -#include <QDir> #include <QFutureInterface> #include <QStack> @@ -682,19 +680,19 @@ bool Snapshot::isEmpty() const return _documents.isEmpty(); } -Snapshot::const_iterator Snapshot::find(const Utils::FilePath &fileName) const +Snapshot::const_iterator Snapshot::find(const FilePath &filePath) const { - return _documents.find(fileName); + return _documents.find(filePath); } -void Snapshot::remove(const Utils::FilePath &fileName) +void Snapshot::remove(const FilePath &filePath) { - _documents.remove(fileName); + _documents.remove(filePath); } -bool Snapshot::contains(const Utils::FilePath &fileName) const +bool Snapshot::contains(const FilePath &filePath) const { - return _documents.contains(fileName); + return _documents.contains(filePath); } void Snapshot::insert(Document::Ptr doc) @@ -790,11 +788,11 @@ QSet<FilePath> Snapshot::allIncludesForDocument(const FilePath &filePath) const QList<Snapshot::IncludeLocation> Snapshot::includeLocationsOfDocument( const QString &fileNameOrPath) const { - const bool matchFullPath = Utils::FilePath::fromString(fileNameOrPath).isAbsolutePath(); + const bool matchFullPath = FilePath::fromString(fileNameOrPath).isAbsolutePath(); const auto isMatch = [&](const Document::Include &include) { if (matchFullPath) return include.resolvedFileName() == fileNameOrPath; - return Utils::FilePath::fromString(include.resolvedFileName()).fileName() == fileNameOrPath; + return FilePath::fromString(include.resolvedFileName()).fileName() == fileNameOrPath; }; QList<IncludeLocation> result; for (const_iterator cit = begin(), citEnd = end(); cit != citEnd; ++cit) { diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index f46de300f4..599b8cbc71 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -32,7 +32,7 @@ class CPLUSPLUS_EXPORT Document Document(const Document &other); void operator =(const Document &other); - Document(const Utils::FilePath &fileName); + Document(const Utils::FilePath &filePath); public: typedef QSharedPointer<Document> Ptr; @@ -380,23 +380,23 @@ public: bool isEmpty() const; void insert(Document::Ptr doc); // ### remove - void remove(const Utils::FilePath &fileName); // ### remove + void remove(const Utils::FilePath &filePath); // ### remove const_iterator begin() const { return _documents.begin(); } const_iterator end() const { return _documents.end(); } - bool contains(const Utils::FilePath &fileName) const; + bool contains(const Utils::FilePath &filePath) const; - Document::Ptr document(const Utils::FilePath &fileName) const; + Document::Ptr document(const Utils::FilePath &filePath) const; Document::Ptr document(const QString &fileName) const { return document(Utils::FilePath::fromString(fileName)); } - const_iterator find(const Utils::FilePath &fileName) const; + const_iterator find(const Utils::FilePath &filePath) const; Snapshot simplified(Document::Ptr doc) const; Document::Ptr preprocessedDocument(const QByteArray &source, - const Utils::FilePath &fileName, + const Utils::FilePath &filePath, int withDefinedMacrosFromDocumentUntilLine = -1) const; Document::Ptr documentFromSource(const QByteArray &preprocessedDocument, @@ -406,7 +406,7 @@ public: QList<IncludeLocation> includeLocationsOfDocument(const QString &fileNameOrPath) const; - Utils::FilePaths filesDependingOn(const Utils::FilePath &fileName) const; + Utils::FilePaths filesDependingOn(const Utils::FilePath &filePath) const; void updateDependencyTable() const; void updateDependencyTable(QFutureInterfaceBase &futureInterface) const; |