qmake: make more use of ProString built-ins
saves some noisy toQString() uses. Change-Id: I62a9e2725c4baabac311124d19c7d8b40f54c8f7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
ccb8afcda7
commit
ce5e6876d4
@ -1902,7 +1902,7 @@ int
|
|||||||
ProjectBuilderMakefileGenerator::pbuilderVersion() const
|
ProjectBuilderMakefileGenerator::pbuilderVersion() const
|
||||||
{
|
{
|
||||||
if (!project->isEmpty("QMAKE_PBUILDER_VERSION"))
|
if (!project->isEmpty("QMAKE_PBUILDER_VERSION"))
|
||||||
return project->first("QMAKE_PBUILDER_VERSION").toQString().toInt();
|
return project->first("QMAKE_PBUILDER_VERSION").toInt();
|
||||||
return 46; // Xcode 3.2-compatible; default format since that version
|
return 46; // Xcode 3.2-compatible; default format since that version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1763,13 +1763,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
if (args.count() >= 3) {
|
if (args.count() >= 3) {
|
||||||
const auto opts = split_value_list(args.at(2).toQStringRef());
|
const auto opts = split_value_list(args.at(2).toQStringRef());
|
||||||
for (const ProString &opt : opts) {
|
for (const ProString &opt : opts) {
|
||||||
opt.toQString(m_tmp3);
|
if (opt == QLatin1String("append")) {
|
||||||
if (m_tmp3 == QLatin1String("append")) {
|
|
||||||
mode = QIODevice::Append;
|
mode = QIODevice::Append;
|
||||||
} else if (m_tmp3 == QLatin1String("exe")) {
|
} else if (opt == QLatin1String("exe")) {
|
||||||
exe = true;
|
exe = true;
|
||||||
} else {
|
} else {
|
||||||
evalError(fL1S("write_file(): invalid flag %1.").arg(m_tmp3));
|
evalError(fL1S("write_file(): invalid flag %1.").arg(opt.toQString(m_tmp3)));
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1807,21 +1806,20 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
if (args.count() >= 2) {
|
if (args.count() >= 2) {
|
||||||
const auto opts = split_value_list(args.at(1).toQStringRef());
|
const auto opts = split_value_list(args.at(1).toQStringRef());
|
||||||
for (const ProString &opt : opts) {
|
for (const ProString &opt : opts) {
|
||||||
opt.toQString(m_tmp3);
|
if (opt == QLatin1String("transient")) {
|
||||||
if (m_tmp3 == QLatin1String("transient")) {
|
|
||||||
persist = false;
|
persist = false;
|
||||||
} else if (m_tmp3 == QLatin1String("super")) {
|
} else if (opt == QLatin1String("super")) {
|
||||||
target = TargetSuper;
|
target = TargetSuper;
|
||||||
} else if (m_tmp3 == QLatin1String("stash")) {
|
} else if (opt == QLatin1String("stash")) {
|
||||||
target = TargetStash;
|
target = TargetStash;
|
||||||
} else if (m_tmp3 == QLatin1String("set")) {
|
} else if (opt == QLatin1String("set")) {
|
||||||
mode = CacheSet;
|
mode = CacheSet;
|
||||||
} else if (m_tmp3 == QLatin1String("add")) {
|
} else if (opt == QLatin1String("add")) {
|
||||||
mode = CacheAdd;
|
mode = CacheAdd;
|
||||||
} else if (m_tmp3 == QLatin1String("sub")) {
|
} else if (opt == QLatin1String("sub")) {
|
||||||
mode = CacheSub;
|
mode = CacheSub;
|
||||||
} else {
|
} else {
|
||||||
evalError(fL1S("cache(): invalid flag %1.").arg(m_tmp3));
|
evalError(fL1S("cache(): invalid flag %1.").arg(opt.toQString(m_tmp3)));
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -973,11 +973,9 @@ void QMakeEvaluator::setTemplate()
|
|||||||
values.erase(values.begin() + 1, values.end());
|
values.erase(values.begin() + 1, values.end());
|
||||||
}
|
}
|
||||||
if (!m_option->user_template_prefix.isEmpty()) {
|
if (!m_option->user_template_prefix.isEmpty()) {
|
||||||
QString val = values.first().toQString(m_tmp1);
|
ProString val = values.first();
|
||||||
if (!val.startsWith(m_option->user_template_prefix)) {
|
if (!val.startsWith(m_option->user_template_prefix))
|
||||||
val.prepend(m_option->user_template_prefix);
|
values = ProStringList(ProString(m_option->user_template_prefix + val));
|
||||||
values = ProStringList(ProString(val));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1745,7 +1743,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBoolFunction(
|
|||||||
if (ret.at(0) == statics.strtrue)
|
if (ret.at(0) == statics.strtrue)
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
bool ok;
|
bool ok;
|
||||||
int val = ret.at(0).toQString(m_tmp1).toInt(&ok);
|
int val = ret.at(0).toInt(&ok);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (val)
|
if (val)
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user