forked from qt-creator/qt-creator
make the feature file search do fewer useless stat()s
qmake ensures that the file name ends with .prf, so there is no point if we try it without first.
This commit is contained in:
@@ -2389,26 +2389,20 @@ bool ProFileEvaluator::Private::evaluateFile(const QString &fileName)
|
|||||||
|
|
||||||
bool ProFileEvaluator::Private::evaluateFeatureFile(const QString &fileName)
|
bool ProFileEvaluator::Private::evaluateFeatureFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
QString fn;
|
QString fn = QLatin1Char('/') + fileName;
|
||||||
|
if (!fn.endsWith(QLatin1String(".prf")))
|
||||||
|
fn += QLatin1String(".prf");
|
||||||
foreach (const QString &path, qmakeFeaturePaths()) {
|
foreach (const QString &path, qmakeFeaturePaths()) {
|
||||||
QString fname = path + QLatin1Char('/') + fileName;
|
QString fname = path + fn;
|
||||||
if (QFileInfo(fname).exists()) {
|
if (QFileInfo(fname).exists()) {
|
||||||
fn = fname;
|
bool cumulative = m_cumulative;
|
||||||
break;
|
m_cumulative = false;
|
||||||
}
|
bool ok = evaluateFile(fname);
|
||||||
fname += QLatin1String(".prf");
|
m_cumulative = cumulative;
|
||||||
if (QFileInfo(fname).exists()) {
|
return ok;
|
||||||
fn = fname;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fn.isEmpty())
|
return false;
|
||||||
return false;
|
|
||||||
bool cumulative = m_cumulative;
|
|
||||||
m_cumulative = false;
|
|
||||||
bool ok = evaluateFile(fn);
|
|
||||||
m_cumulative = cumulative;
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProFileEvaluator::Private::format(const char *fmt) const
|
QString ProFileEvaluator::Private::format(const char *fmt) const
|
||||||
|
|||||||
Reference in New Issue
Block a user