diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-10-18 15:14:33 +0100 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2015-10-18 23:12:14 +0000 |
commit | 4867a49618e0d6a476e0549aeca5134b2e3c5892 (patch) | |
tree | 769bb64015acaa22e9c86d90cff4093877fc0ead /src/qml | |
parent | 35fa7aed1db1157a7189ff271ebd241ebe04d2cc (diff) |
Use QStringRef in a bunch of places.wip/dbus
Done automatically with clazy static analyzer.
Change-Id: Ia0cf8fa24331ab102a3c3c30c2aa92ef1ba772e2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlstringconverters.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 110a2c9089..b4733356ac 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -302,7 +302,7 @@ static QString decode(const QString &input, DecodeMode decodeMode, bool *ok) ++r; } if (*r) - output.append(input.mid(start, i - start + 1)); + output.append(input.midRef(start, i - start + 1)); else output.append(QChar(b)); } else { diff --git a/src/qml/qml/qqmlstringconverters.cpp b/src/qml/qml/qqmlstringconverters.cpp index eb0afda927..6a5c0736cf 100644 --- a/src/qml/qml/qqmlstringconverters.cpp +++ b/src/qml/qml/qqmlstringconverters.cpp @@ -137,8 +137,8 @@ QPointF QQmlStringConverters::pointFFromString(const QString &s, bool *ok) bool xGood, yGood; int index = s.indexOf(QLatin1Char(',')); - qreal xCoord = s.left(index).toDouble(&xGood); - qreal yCoord = s.mid(index+1).toDouble(&yGood); + qreal xCoord = s.leftRef(index).toDouble(&xGood); + qreal yCoord = s.midRef(index+1).toDouble(&yGood); if (!xGood || !yGood) { if (ok) *ok = false; @@ -161,8 +161,8 @@ QSizeF QQmlStringConverters::sizeFFromString(const QString &s, bool *ok) bool wGood, hGood; int index = s.indexOf(QLatin1Char('x')); - qreal width = s.left(index).toDouble(&wGood); - qreal height = s.mid(index+1).toDouble(&hGood); + qreal width = s.leftRef(index).toDouble(&wGood); + qreal height = s.midRef(index+1).toDouble(&hGood); if (!wGood || !hGood) { if (ok) *ok = false; @@ -185,12 +185,12 @@ QRectF QQmlStringConverters::rectFFromString(const QString &s, bool *ok) bool xGood, yGood, wGood, hGood; int index = s.indexOf(QLatin1Char(',')); - qreal x = s.left(index).toDouble(&xGood); + qreal x = s.leftRef(index).toDouble(&xGood); int index2 = s.indexOf(QLatin1Char(','), index+1); - qreal y = s.mid(index+1, index2-index-1).toDouble(&yGood); + qreal y = s.midRef(index+1, index2-index-1).toDouble(&yGood); index = s.indexOf(QLatin1Char('x'), index2+1); - qreal width = s.mid(index2+1, index-index2-1).toDouble(&wGood); - qreal height = s.mid(index+1).toDouble(&hGood); + qreal width = s.midRef(index2+1, index-index2-1).toDouble(&wGood); + qreal height = s.midRef(index+1).toDouble(&hGood); if (!xGood || !yGood || !wGood || !hGood) { if (ok) *ok = false; |