forked from qt-creator/qt-creator
CppEditor: Proliferate FilePath use
Remove SnapShot::{find,contains}(QString) overloads and fix fallout.
Change-Id: I50c415826939e09ac111f33def611c7478fa5d97
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -388,16 +388,12 @@ public:
|
||||
const_iterator end() const { return _documents.end(); }
|
||||
|
||||
bool contains(const Utils::FilePath &fileName) const;
|
||||
bool contains(const QString &fileName) const
|
||||
{ return contains(Utils::FilePath::fromString(fileName)); }
|
||||
|
||||
Document::Ptr document(const Utils::FilePath &fileName) 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 QString &fileName) const
|
||||
{ return find(Utils::FilePath::fromString(fileName)); }
|
||||
|
||||
Snapshot simplified(Document::Ptr doc) const;
|
||||
|
||||
|
||||
@@ -716,7 +716,11 @@ void Preprocessor::State::updateIncludeGuardState_helper(IncludeGuardStateHint h
|
||||
#endif // DEBUG_INCLUDE_GUARD_TRACKING
|
||||
}
|
||||
|
||||
QString Preprocessor::configurationFileName() { return QStringLiteral("<configuration>"); }
|
||||
const FilePath &Preprocessor::configurationFileName()
|
||||
{
|
||||
const static FilePath configurationFile = FilePath::fromPathPart(u"<configuration>");
|
||||
return configurationFile;
|
||||
}
|
||||
|
||||
Preprocessor::Preprocessor(Client *client, Environment *env)
|
||||
: m_client(client)
|
||||
@@ -2010,7 +2014,7 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
|
||||
|
||||
// the macro is a feature constraint(e.g. QT_NO_XXX)
|
||||
if (checkUndefined && macroName.startsWith("QT_NO_")) {
|
||||
if (macro->fileName() == configurationFileName()) {
|
||||
if (macro->fileName() == configurationFileName().pathView()) {
|
||||
// and it' defined in a pro file (e.g. DEFINES += QT_NO_QOBJECT)
|
||||
|
||||
value = false; // take the branch
|
||||
|
||||
@@ -54,7 +54,7 @@ class CPLUSPLUS_EXPORT Preprocessor
|
||||
typedef Internal::Value Value;
|
||||
|
||||
public:
|
||||
static QString configurationFileName();
|
||||
static const Utils::FilePath &configurationFileName();
|
||||
|
||||
public:
|
||||
Preprocessor(Client *client, Environment *env);
|
||||
|
||||
Reference in New Issue
Block a user