From 396c7e530d5aea6cce03600e392ca42235744c06 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 May 2016 13:42:15 +0200 Subject: [PATCH] add ProString::toLongLong() and make use of it this is just a bit cleaner. Change-Id: I03e628aca9e2e53c602a4db724da277a0e2c2486 Reviewed-by: Joerg Bornemann (cherry picked from qtbase/e6b755e702fd6d8ebeb25ecd7a5059e62da6c971) Reviewed-by: Jake Petroules --- src/linguist/shared/proitems.h | 1 + src/linguist/shared/qmakebuiltins.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/linguist/shared/proitems.h b/src/linguist/shared/proitems.h index 035be2442a..efb86cf457 100644 --- a/src/linguist/shared/proitems.h +++ b/src/linguist/shared/proitems.h @@ -130,6 +130,7 @@ class ProString { bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; } bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; } bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; } + int toLongLong(bool *ok = 0, int base = 10) const { return toQStringRef().toLongLong(ok, base); } int toInt(bool *ok = 0, int base = 10) const { return toQStringRef().toInt(ok, base); } short toShort(bool *ok = 0, int base = 10) const { return toQStringRef().toShort(ok, base); } diff --git a/src/linguist/shared/qmakebuiltins.cpp b/src/linguist/shared/qmakebuiltins.cpp index 4ae9f37f28..f8fa32782a 100644 --- a/src/linguist/shared/qmakebuiltins.cpp +++ b/src/linguist/shared/qmakebuiltins.cpp @@ -570,7 +570,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( break; } bool ok; - qlonglong num = m_tmp3.toLongLong(&ok, ibase); + qlonglong num = args.at(0).toLongLong(&ok, ibase); if (!ok) { evalError(fL1S("format_number(): malformed number %2 for base %1.") .arg(ibase).arg(m_tmp3));