forked from qt-creator/qt-creator
qmake: use nullptr
Change-Id: I372c0b49b894c3758621e2e9d2b73aaa49371dde Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -840,7 +840,7 @@ bool QmakePriFile::ensureWriteableProFile(const QString &file)
|
|||||||
QPair<ProFile *, QStringList> QmakePriFile::readProFile(const QString &file)
|
QPair<ProFile *, QStringList> QmakePriFile::readProFile(const QString &file)
|
||||||
{
|
{
|
||||||
QStringList lines;
|
QStringList lines;
|
||||||
ProFile *includeFile = 0;
|
ProFile *includeFile = nullptr;
|
||||||
{
|
{
|
||||||
QString contents;
|
QString contents;
|
||||||
{
|
{
|
||||||
@@ -856,7 +856,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile(const QString &file)
|
|||||||
|
|
||||||
QMakeVfs vfs;
|
QMakeVfs vfs;
|
||||||
QtSupport::ProMessageHandler handler;
|
QtSupport::ProMessageHandler handler;
|
||||||
QMakeParser parser(0, &vfs, &handler);
|
QMakeParser parser(nullptr, &vfs, &handler);
|
||||||
includeFile = parser.parsedProBlock(QStringRef(&contents), file, 1);
|
includeFile = parser.parsedProBlock(QStringRef(&contents), file, 1);
|
||||||
}
|
}
|
||||||
return qMakePair(includeFile, lines);
|
return qMakePair(includeFile, lines);
|
||||||
@@ -891,7 +891,7 @@ bool QmakePriFile::renameFile(const QString &oldName,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We need to re-parse here: The file has changed.
|
// We need to re-parse here: The file has changed.
|
||||||
QMakeParser parser(0, 0, 0);
|
QMakeParser parser(nullptr, nullptr, nullptr);
|
||||||
QString contents = lines.join(QLatin1Char('\n'));
|
QString contents = lines.join(QLatin1Char('\n'));
|
||||||
includeFile = parser.parsedProBlock(QStringRef(&contents),
|
includeFile = parser.parsedProBlock(QStringRef(&contents),
|
||||||
filePath().toString(), 1, QMakeParser::FullGrammar);
|
filePath().toString(), 1, QMakeParser::FullGrammar);
|
||||||
@@ -1205,7 +1205,7 @@ QmakeProFile *QmakeProFile::findProFileFor(const FileName &fileName) const
|
|||||||
if (QmakeProFile *qmakeProFileNode = dynamic_cast<QmakeProFile *>(pn))
|
if (QmakeProFile *qmakeProFileNode = dynamic_cast<QmakeProFile *>(pn))
|
||||||
if (QmakeProFile *result = qmakeProFileNode->findProFileFor(fileName))
|
if (QmakeProFile *result = qmakeProFileNode->findProFileFor(fileName))
|
||||||
return result;
|
return result;
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmakeProFile::makefile() const
|
QString QmakeProFile::makefile() const
|
||||||
@@ -1257,17 +1257,13 @@ QByteArray QmakeProFile::cxxDefines() const
|
|||||||
\class QmakeProFile
|
\class QmakeProFile
|
||||||
Implements abstract ProjectNode class
|
Implements abstract ProjectNode class
|
||||||
*/
|
*/
|
||||||
QmakeProFile::QmakeProFile(QmakeProject *project,
|
QmakeProFile::QmakeProFile(QmakeProject *project, const FileName &filePath) :
|
||||||
const FileName &filePath)
|
QmakePriFile(project, this, filePath)
|
||||||
: QmakePriFile(project, this, filePath)
|
|
||||||
{
|
{
|
||||||
// The slot is a lambda, so that QmakeProFile does not need to be
|
// The lifetime of the m_parserFutureWatcher is shorter
|
||||||
// a qobject. The lifetime of the m_parserFutureWatcher is shorter
|
|
||||||
// than of this, so this is all safe
|
// than of this, so this is all safe
|
||||||
QObject::connect(&m_parseFutureWatcher, &QFutureWatcherBase::finished,
|
QObject::connect(&m_parseFutureWatcher, &QFutureWatcherBase::finished,
|
||||||
[this](){
|
[this](){ applyAsyncEvaluate(); });
|
||||||
applyAsyncEvaluate();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QmakeProFile::~QmakeProFile()
|
QmakeProFile::~QmakeProFile()
|
||||||
@@ -1515,7 +1511,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result->projectType == ProjectType::SubDirsTemplate) {
|
if (result->projectType == ProjectType::SubDirsTemplate) {
|
||||||
FileNameList subDirs = subDirsPaths(input.readerCumulative, input.projectDir, 0, 0);
|
FileNameList subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr);
|
||||||
foreach (const Utils::FileName &subDirName, subDirs) {
|
foreach (const Utils::FileName &subDirName, subDirs) {
|
||||||
auto it = result->includedFiles.children.find(subDirName);
|
auto it = result->includedFiles.children.find(subDirName);
|
||||||
if (it == result->includedFiles.children.end()) {
|
if (it == result->includedFiles.children.end()) {
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ public:
|
|||||||
bool addSubProjects(const QStringList &proFilePaths) override;
|
bool addSubProjects(const QStringList &proFilePaths) override;
|
||||||
bool removeSubProjects(const QStringList &proFilePaths) override;
|
bool removeSubProjects(const QStringList &proFilePaths) override;
|
||||||
|
|
||||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||||
bool deleteFiles(const QStringList &filePaths) override;
|
bool deleteFiles(const QStringList &filePaths) override;
|
||||||
bool canRenameFile(const QString &filePath, const QString &newFilePath) override;
|
bool canRenameFile(const QString &filePath, const QString &newFilePath) override;
|
||||||
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
||||||
@@ -286,7 +286,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString sourceDir() const;
|
QString sourceDir() const;
|
||||||
QString buildDir(QmakeBuildConfiguration *bc = 0) const;
|
QString buildDir(QmakeBuildConfiguration *bc = nullptr) const;
|
||||||
|
|
||||||
QStringList generatedFiles(const QString &buildDirectory,
|
QStringList generatedFiles(const QString &buildDirectory,
|
||||||
const ProjectExplorer::FileNode *sourceFile) const;
|
const ProjectExplorer::FileNode *sourceFile) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user