summaryrefslogtreecommitdiffstats
path: root/src/linguist/shared/qmakeevaluator.cpp
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-06-11 14:10:22 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-06-15 12:39:22 +0200
commit6f5d0c8d5c373c92dbabd495508e223f9f9fd1a7 (patch)
tree5633ab89b4941dc4beacc5fd47c49b7211e26711 /src/linguist/shared/qmakeevaluator.cpp
parentd98ed1aaedf4a188b482a0d886195bf4cbe44c60 (diff)
Port QtTools from QStringRef to QStringView
Task-number: QTBUG-84319 Change-Id: Idb5a41172ea38b2f4edf385d67c1cdc2968a8d8c Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/linguist/shared/qmakeevaluator.cpp')
-rw-r--r--src/linguist/shared/qmakeevaluator.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp
index f3805255f..37601b388 100644
--- a/src/linguist/shared/qmakeevaluator.cpp
+++ b/src/linguist/shared/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;
@@ -1316,7 +1316,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());
@@ -1625,7 +1625,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)
@@ -1821,7 +1821,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);
@@ -1839,7 +1839,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)
@@ -2005,7 +2005,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;