Commit bc390a8e authored by Tobias Hunger's avatar Tobias Hunger Committed by Tim Jenssen

qmake: Do not use out-parameters for QmakeProject::findProFile

Change-Id: I9eec5138ebe0d3c02dadb91c66146e4419fc9cd3
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 8eb63d83
...@@ -956,21 +956,24 @@ bool QmakeProject::hasSubNode(QmakePriFileNode *root, const FileName &path) ...@@ -956,21 +956,24 @@ bool QmakeProject::hasSubNode(QmakePriFileNode *root, const FileName &path)
return false; return false;
} }
void QmakeProject::findProFile(const FileName &fileName, QmakeProFileNode *root, QList<QmakeProFileNode *> &list) QList<QmakeProFileNode *> QmakeProject::findProFile(const FileName &fileName, QmakeProFileNode *root)
{ {
QList<QmakeProFileNode *> result;
if (hasSubNode(root, fileName)) if (hasSubNode(root, fileName))
list.append(root); result.append(root);
foreach (FolderNode *fn, root->folderNodes()) foreach (FolderNode *fn, root->folderNodes()) {
if (QmakeProFileNode *qt4proFileNode = dynamic_cast<QmakeProFileNode *>(fn)) if (QmakeProFileNode *qt4proFileNode = dynamic_cast<QmakeProFileNode *>(fn))
findProFile(fileName, qt4proFileNode, list); result.append(findProFile(fileName, qt4proFileNode));
}
return result;
} }
void QmakeProject::notifyChanged(const FileName &name) void QmakeProject::notifyChanged(const FileName &name)
{ {
if (files(QmakeProject::SourceFiles).contains(name.toString())) { if (files(QmakeProject::SourceFiles).contains(name.toString())) {
QList<QmakeProFileNode *> list; const QList<QmakeProFileNode *> list = findProFile(name, rootProjectNode());
findProFile(name, rootProjectNode(), list);
foreach (QmakeProFileNode *node, list) { foreach (QmakeProFileNode *node, list) {
QtSupport::ProFileCacheManager::instance()->discardFile(name.toString()); QtSupport::ProFileCacheManager::instance()->discardFile(name.toString());
node->scheduleUpdate(QmakeProFile::ParseNow); node->scheduleUpdate(QmakeProFile::ParseNow);
......
...@@ -165,7 +165,7 @@ private: ...@@ -165,7 +165,7 @@ private:
static void collectAllProFiles(QList<QmakeProFileNode *> &list, QmakeProFileNode *node, Parsing parse, static void collectAllProFiles(QList<QmakeProFileNode *> &list, QmakeProFileNode *node, Parsing parse,
const QList<ProjectType> &projectTypes); const QList<ProjectType> &projectTypes);
static void findProFile(const Utils::FileName &fileName, QmakeProFileNode *root, QList<QmakeProFileNode *> &list); static QList<QmakeProFileNode *> findProFile(const Utils::FileName &fileName, QmakeProFileNode *root);
static bool hasSubNode(QmakePriFileNode *root, const Utils::FileName &path); static bool hasSubNode(QmakePriFileNode *root, const Utils::FileName &path);
static bool equalFileList(const QStringList &a, const QStringList &b); static bool equalFileList(const QStringList &a, const QStringList &b);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment