From 3277143f9609a0c257dd118c7fa4900b2fb36de3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 22 Aug 2016 17:25:02 +0200 Subject: [PATCH] make include(,) implementation a bit less convoluted this goes at the cost of without the subsequent dot not being filtered before the result insertion any more. that's not expected to be a problem, as it's not particularly useful to iterate the target namespace without the dot in the first place. Change-Id: Ib3497a60613b4c8c26676fe76b731239e427b8a7 Reviewed-by: Lars Knoll --- qmake/library/proitems.h | 4 ++++ qmake/library/qmakebuiltins.cpp | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index 165ce40189d..a3d2c01760a 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -211,6 +211,10 @@ inline QString operator+(const ProString &one, const char *two) { QString ret = one.toQStringRef() + two; ret.detach(); return ret; } inline QString operator+(const char *one, const ProString &two) { QString ret = one + two.toQStringRef(); ret.detach(); return ret; } +inline QString operator+(const ProString &one, QChar two) + { return one.toQStringRef() + two; } +inline QString operator+(QChar one, const ProString &two) + { return one + two.toQStringRef(); } inline QString &operator+=(QString &that, const ProString &other) { return that += other.toQStringRef(); } diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index ba621c1c722..1be57bd8458 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1519,7 +1519,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( if (m_cumulative) flags = LoadSilent; if (args.count() >= 2) { - parseInto = args.at(1).toQString(m_tmp2); + if (!args.at(1).isEmpty()) + parseInto = args.at(1) + QLatin1Char('.'); if (args.count() >= 3 && isTrue(args.at(2))) flags = LoadSilent; } @@ -1536,17 +1537,15 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( it = m_valuemapStack.top().constBegin(), end = m_valuemapStack.top().constEnd(); it != end; ++it) { - const QString &ky = it.key().toQString(m_tmp1); - if (!(ky.startsWith(parseInto) && - (ky.length() == parseInto.length() - || ky.at(parseInto.length()) == QLatin1Char('.')))) + const ProString &ky = it.key(); + if (!ky.startsWith(parseInto)) newMap[it.key()] = it.value(); } for (ProValueMap::ConstIterator it = symbols.constBegin(); it != symbols.constEnd(); ++it) { const QString &ky = it.key().toQString(m_tmp1); if (!ky.startsWith(QLatin1Char('.'))) - newMap.insert(ProKey(parseInto + QLatin1Char('.') + ky), it.value()); + newMap.insert(ProKey(parseInto + ky), it.value()); } m_valuemapStack.top() = newMap; }