diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-22 17:25:02 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-10-10 09:57:18 +0000 |
commit | 4e2bf4fbe5fb19c74c6e4591434703e45dcf80b3 (patch) | |
tree | 6f2442cce834958b4aca582a861a887239ca01fe /src/linguist/shared/qmakebuiltins.cpp | |
parent | 472c93ddeea83fe90286e8ec395e17cd73ccfca4 (diff) |
make include(,<into>) implementation a bit less convoluted
this goes at the cost of <into> 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 <lars.knoll@qt.io>
(cherry picked from qtbase/3277143f9609a0c257dd118c7fa4900b2fb36de3)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/linguist/shared/qmakebuiltins.cpp')
-rw-r--r-- | src/linguist/shared/qmakebuiltins.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/linguist/shared/qmakebuiltins.cpp b/src/linguist/shared/qmakebuiltins.cpp index c701addbe..b19c89079 100644 --- a/src/linguist/shared/qmakebuiltins.cpp +++ b/src/linguist/shared/qmakebuiltins.cpp @@ -1521,7 +1521,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; } @@ -1538,17 +1539,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; } |