diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-06-08 15:12:08 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-08-12 12:09:35 +0000 |
commit | 829c8faee2bd3eed6b62325290f16738e2b5cf5e (patch) | |
tree | 5dd94fd2fa86c0db50e60091a9df6bc50a0bb839 /tools/qmlprofiler | |
parent | 4a7e03fc700cb7431df20a31bed6834a31e6833e (diff) |
tools: use QStringRef more
Change-Id: I4fccbfb2b965daf3a31846d1d51d39eb74ad944d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools/qmlprofiler')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 6 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerdata.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index 063e5e2961..45c32487a2 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -347,7 +347,7 @@ bool QmlProfilerApplication::checkOutputFile(PendingRequest pending) void QmlProfilerApplication::userCommand(const QString &command) { - QStringList args = command.split(QChar::Space, QString::SkipEmptyParts); + auto args = command.splitRef(QChar::Space, QString::SkipEmptyParts); if (args.isEmpty()) { prompt(); return; @@ -401,7 +401,7 @@ void QmlProfilerApplication::userCommand(const QString &command) } else if (m_profilerData.isEmpty()) { prompt(tr("No data was recorded so far.")); } else { - m_interactiveOutputFile = args.length() > 0 ? args[0] : m_outputFile; + m_interactiveOutputFile = args.length() > 0 ? args.at(0).toString() : m_outputFile; if (checkOutputFile(REQUEST_OUTPUT_FILE)) output(); } @@ -418,7 +418,7 @@ void QmlProfilerApplication::userCommand(const QString &command) if (!m_recording && m_profilerData.isEmpty()) { prompt(tr("No data was recorded so far.")); } else { - m_interactiveOutputFile = args.length() > 0 ? args[0] : m_outputFile; + m_interactiveOutputFile = args.length() > 0 ? args.at(0).toString() : m_outputFile; if (checkOutputFile(REQUEST_FLUSH_FILE)) flush(); } diff --git a/tools/qmlprofiler/qmlprofilerdata.cpp b/tools/qmlprofiler/qmlprofilerdata.cpp index 74fa44c1d6..b651b2724f 100644 --- a/tools/qmlprofiler/qmlprofilerdata.cpp +++ b/tools/qmlprofiler/qmlprofilerdata.cpp @@ -248,7 +248,7 @@ void QmlProfilerData::addQmlEvent(QQmlProfilerDefinitions::RangeType type, eventHashStr = getHashStringForQmlEvent(eventLocation, type); } else { const QString filePath = QUrl(eventLocation.filename).path(); - displayName = filePath.mid( + displayName = filePath.midRef( filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') + QString::number(eventLocation.line); eventHashStr = getHashStringForQmlEvent(eventLocation, type); @@ -327,8 +327,8 @@ void QmlProfilerData::addPixmapCacheEvent(QQmlProfilerDefinitions::PixmapEventTy QString filePath = QUrl(location).path(); - QString eventHashStr = filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + - QStringLiteral(":") + QString::number(type); + const QString eventHashStr = filePath.midRef(filePath.lastIndexOf(QLatin1Char('/')) + 1) + + QLatin1Char(':') + QString::number(type); QmlRangeEventData *newEvent; if (d->eventDescriptions.contains(eventHashStr)) { newEvent = d->eventDescriptions[eventHashStr]; |