From 7754606beab6110f59c5f5f72ba523912764dc8b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Oct 2016 18:51:35 +0200 Subject: [PATCH] don't collect dynamic variable names from cumulative reader we actually use variable values only from the exact reader, based on the idea that the cumulative parse is too dangerous, as using recursive watches on inexact data may be a bit heavy. using additional variable names from the cumulative reader sort of defeats the idea. Change-Id: I8bf3e298bf89593dcc77548cc3d2cbf7881202dd Reviewed-by: Tobias Hunger --- .../qmakeprojectmanager/qmakenodes.cpp | 30 +++++-------------- src/plugins/qmakeprojectmanager/qmakenodes.h | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index b21616bf540..3c7a752aa14 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -646,17 +646,15 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input, { PriFileEvalResult result; - // Figure out DEPLOYMENT and INSTALL folders - QStringList dynamicVariables = dynamicVarNames(input.readerExact, input.readerCumulative, input.isQt5); + // Figure out DEPLOYMENT and INSTALL folders. + // Ignore stuff from cumulative parse, as we are recursively enumerating + // all the files from those folders and add watchers for them. That's too + // dangerous if we get the folders wrong and enumerate the whole project + // tree multiple times. + QStringList dynamicVariables = dynamicVarNames(input.readerExact, input.isQt5); foreach (ProFile *includeFileExact, includeFilesExact) - foreach (const QString &dynamicVar, dynamicVariables) { + foreach (const QString &dynamicVar, dynamicVariables) result.folders += input.readerExact->values(dynamicVar, includeFileExact); - // Ignore stuff from cumulative parse - // we are recursively enumerating all the files from those folders - // and add watchers for them, that's too dangerous if we get the folders - // wrong and enumerate the whole project tree multiple times - } - for (int i=0; i < result.folders.size(); ++i) { const QFileInfo fi(result.folders.at(i)); @@ -1475,7 +1473,7 @@ QStringList QmakePriFileNode::varNamesForRemoving() return vars; } -QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative, +QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExact, bool isQt5) { QStringList result; @@ -1487,12 +1485,6 @@ QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerEx foreach (const QString &var, listOfVars) { result << (var + sources); } - if (readerCumulative) { - QStringList listOfVars = readerCumulative->values(deployment); - foreach (const QString &var, listOfVars) { - result << (var + sources); - } - } const QString installs = QLatin1String("INSTALLS"); const QString files = QLatin1String(".files"); @@ -1500,12 +1492,6 @@ QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerEx foreach (const QString &var, listOfVars) { result << (var + files); } - if (readerCumulative) { - QStringList listOfVars = readerCumulative->values(installs); - foreach (const QString &var, listOfVars) { - result << (var + files); - } - } result.removeDuplicates(); return result; } diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h index 8d8d651c3fe..1bb881f482a 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.h +++ b/src/plugins/qmakeprojectmanager/qmakenodes.h @@ -180,7 +180,7 @@ protected: static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact); static QStringList varNamesForRemoving(); static QString varNameForAdding(const QString &mimeType); - static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative, bool isQt5); + static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, bool isQt5); static QSet filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet &files); static QSet filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet &files);