diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-05-30 23:29:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-06-05 09:07:14 +0200 |
commit | c49728eb27be0f3f2eaaa77b0ed573f5d8705af1 (patch) | |
tree | 7115e967f463ab66c8df40dfd573cf5c8ddb8055 /qmake/library/qmakeevaluator.cpp | |
parent | 690abaac0e4bd57b5510e68730f7965c01a113da (diff) |
Port qmake from QStringRef to QStringView
Change-Id: Ie07a976cd3c634e04c8b9b1e0a6cacd4c2d94939
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'qmake/library/qmakeevaluator.cpp')
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 51e26f343b..e3b20771d4 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -272,7 +272,7 @@ void QMakeEvaluator::skipHashStr(const ushort *&tokPtr) // FIXME: this should not build new strings for direct sections. // Note that the E_SPRINTF and E_LIST implementations rely on the deep copy. -ProStringList QMakeEvaluator::split_value_list(const QStringRef &vals, int source) +ProStringList QMakeEvaluator::split_value_list(QStringView vals, int source) { QString build; ProStringList ret; @@ -653,7 +653,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock( evalError(fL1S("Conditional must expand to exactly one word.")); okey = false; } else { - okey = isActiveConfig(curr.at(0).toQStringRef(), true); + okey = isActiveConfig(curr.at(0).toQStringView(), true); traceMsg("condition %s is %s", dbgStr(curr.at(0)), dbgBool(okey)); okey ^= invert; } @@ -780,7 +780,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop( } infinite = true; } else { - const QStringRef &itl = it_list.toQStringRef(); + QStringView itl = it_list.toQStringView(); int dotdot = itl.indexOf(statics.strDotDot); if (dotdot != -1) { bool ok; @@ -877,7 +877,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable( ProStringList varVal; if (expandVariableReferences(tokPtr, sizeHint, &varVal, true) == ReturnError) return ReturnError; - const QStringRef &val = varVal.at(0).toQStringRef(); + QStringView val = varVal.at(0).toQStringView(); if (val.length() < 4 || val.at(0) != QLatin1Char('s')) { evalError(fL1S("The ~= operator can handle only the s/// function.")); return ReturnTrue; @@ -1315,7 +1315,7 @@ void QMakeEvaluator::setupProject() void QMakeEvaluator::evaluateCommand(const QString &cmds, const QString &where) { if (!cmds.isEmpty()) { - ProFile *pro = m_parser->parsedProBlock(QStringRef(&cmds), 0, where, -1); + ProFile *pro = m_parser->parsedProBlock(QStringView(cmds), 0, where, -1); if (pro->isOk()) { m_locationStack.push(m_current); visitProBlock(pro, pro->tokPtr()); @@ -1624,7 +1624,7 @@ QString QMakeEvaluator::currentDirectory() const return QString(); } -bool QMakeEvaluator::isActiveConfig(const QStringRef &config, bool regex) +bool QMakeEvaluator::isActiveConfig(QStringView config, bool regex) { // magic types for easy flipping if (config == statics.strtrue) @@ -1820,7 +1820,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateExpandFunction( } QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditional( - const QStringRef &cond, const QString &where, int line) + QStringView cond, const QString &where, int line) { VisitReturn ret = ReturnFalse; ProFile *pro = m_parser->parsedProBlock(cond, 0, where, line, QMakeParser::TestGrammar); @@ -1838,7 +1838,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::checkRequirements(const ProStringLis { ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS")); for (const ProString &dep : deps) { - VisitReturn vr = evaluateConditional(dep.toQStringRef(), m_current.pro->fileName(), m_current.line); + VisitReturn vr = evaluateConditional(dep.toQStringView(), m_current.pro->fileName(), m_current.line); if (vr == ReturnError) return ReturnError; if (vr != ReturnTrue) @@ -2004,7 +2004,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( int start_root = 0; const QStringList &paths = m_featureRoots->paths; if (!currFn.isEmpty()) { - QStringRef currPath = IoUtils::pathName(currFn); + QStringView currPath = IoUtils::pathName(currFn); for (int root = 0; root < paths.size(); ++root) if (currPath == paths.at(root)) { start_root = root + 1; |