From 755d093617bd4ec52dd728bd003fce858b083739 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 12 Jun 2012 22:00:29 +0200 Subject: [PATCH] remove support for loading features relative to current directory follow suit with qmake ... Change-Id: I15a742511ba551dee8e2794a8f75c648e9ba5df0 Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 64 +++++++++++-------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index b16236cc867..b12e9b1a3b6 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -1773,43 +1773,37 @@ bool QMakeEvaluator::evaluateFeatureFile(const QString &fileName) if (!fn.endsWith(QLatin1String(".prf"))) fn += QLatin1String(".prf"); - if ((!fileName.contains((ushort)'/') && !fileName.contains((ushort)'\\')) - || !IoUtils::exists(resolvePath(fn))) { - if (m_option->feature_roots.isEmpty()) - m_option->feature_roots = qmakeFeaturePaths(); - int start_root = 0; - QString currFn = currentFileName(); - if (IoUtils::fileName(currFn) == IoUtils::fileName(fn)) { - for (int root = 0; root < m_option->feature_roots.size(); ++root) - if (currFn == m_option->feature_roots.at(root) + fn) { - start_root = root + 1; - break; - } - } - for (int root = start_root; root < m_option->feature_roots.size(); ++root) { - QString fname = m_option->feature_roots.at(root) + fn; - if (IoUtils::exists(fname)) { - fn = fname; - goto cool; + if (m_option->feature_roots.isEmpty()) + m_option->feature_roots = qmakeFeaturePaths(); + int start_root = 0; + QString currFn = currentFileName(); + if (IoUtils::fileName(currFn) == IoUtils::fileName(fn)) { + for (int root = 0; root < m_option->feature_roots.size(); ++root) + if (currFn == m_option->feature_roots.at(root) + fn) { + start_root = root + 1; + break; } - } -#ifdef QMAKE_BUILTIN_PRFS - fn.prepend(QLatin1String(":/qmake/features/")); - if (QFileInfo(fn).exists()) - goto cool; -#endif - return false; - - cool: - // It's beyond me why qmake has this inside this if ... - ProStringList &already = valuesRef(ProString("QMAKE_INTERNAL_INCLUDED_FEATURES")); - ProString afn(fn, NoHash); - if (already.contains(afn)) - return true; - already.append(afn); - } else { - fn = resolvePath(fn); } + for (int root = start_root; root < m_option->feature_roots.size(); ++root) { + QString fname = m_option->feature_roots.at(root) + fn; + if (IoUtils::exists(fname)) { + fn = fname; + goto cool; + } + } +#ifdef QMAKE_BUILTIN_PRFS + fn.prepend(QLatin1String(":/qmake/features/")); + if (QFileInfo(fn).exists()) + goto cool; +#endif + return false; + + cool: + ProStringList &already = valuesRef(ProString("QMAKE_INTERNAL_INCLUDED_FEATURES")); + ProString afn(fn, NoHash); + if (already.contains(afn)) + return true; + already.append(afn); #ifdef PROEVALUATOR_CUMULATIVE bool cumulative = m_cumulative;