From 16154fba86798bd6bbee90eb79a9f3b26cae2fad Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Oct 2015 12:26:45 +0200 Subject: Tools: Fix single-character string literals. Use character literals where applicable. Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010 Reviewed-by: Ulf Hermann --- tools/qmleasing/segmentproperties.cpp | 2 +- tools/qmleasing/splineeditor.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/qmleasing') diff --git a/tools/qmleasing/segmentproperties.cpp b/tools/qmleasing/segmentproperties.cpp index cfc10b7f54..cf49b2488c 100644 --- a/tools/qmleasing/segmentproperties.cpp +++ b/tools/qmleasing/segmentproperties.cpp @@ -103,7 +103,7 @@ void SegmentProperties::invalidate() { m_blockSignals = true; - m_ui_pane_p.label->setText(QLatin1String("p") + QString::number(m_segment)); + m_ui_pane_p.label->setText(QLatin1Char('p') + QString::number(m_segment)); m_ui_pane_p.smooth->setChecked(m_smooth); m_ui_pane_p.smooth->parentWidget()->setEnabled(!m_last); diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp index b957cab4fe..9e35af6189 100644 --- a/tools/qmleasing/splineeditor.cpp +++ b/tools/qmleasing/splineeditor.cpp @@ -291,10 +291,11 @@ QString SplineEditor::generateCode() { QString s = QLatin1String("["); foreach (const QPointF &point, m_controlPoints) { - s += QString::number(point.x(), 'g', 2) + "," + QString::number(point.y(), 'g', 3) + ","; + s += QString::number(point.x(), 'g', 2) + QLatin1Char(',') + + QString::number(point.y(), 'g', 3) + QLatin1Char(','); } s.chop(1); //removing last "," - s += "]"; + s += QLatin1Char(']'); return s; } @@ -673,7 +674,7 @@ void SplineEditor::setEasingCurve(const QString &code) { if (m_block) return; - if (code.left(1) == QLatin1String("[") && code.right(1) == QLatin1String("]")) { + if (code.startsWith(QLatin1Char('[')) && code.endsWith(QLatin1Char(']'))) { QString cleanCode = code; cleanCode.remove(0, 1); cleanCode.chop(1); -- cgit v1.2.3