Commit 4d11977b authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Reduce usage of QStringRef::toString() in the QML profiler.



Change-Id: Id246bea7c21c61c87d02e3a839b44617e24d58fc
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
parent e81f0e25
......@@ -136,15 +136,14 @@ bool QmlProfilerFileReader::load(QIODevice *device)
while (validVersion && !stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext();
QString elementName = stream.name().toString();
const QStringRef elementName = stream.name();
switch (token) {
case QXmlStreamReader::StartDocument : continue;
case QXmlStreamReader::StartElement : {
if (elementName == _("trace")) {
QXmlStreamAttributes attributes = stream.attributes();
if (attributes.hasAttribute(_("version")))
validVersion = attributes.value(_("version")).toString()
== _(PROFILER_FILE_VERSION);
validVersion = attributes.value(_("version")) == _(PROFILER_FILE_VERSION);
else
validVersion = false;
if (attributes.hasAttribute(_("traceStart")))
......@@ -187,7 +186,7 @@ bool QmlProfilerFileReader::load(QIODevice *device)
void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
{
QTC_ASSERT(stream.name().toString() == _("eventData"), return);
QTC_ASSERT(stream.name() == _("eventData"), return);
QXmlStreamAttributes attributes = stream.attributes();
if (attributes.hasAttribute(_("totalTime"))) {
......@@ -208,7 +207,7 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext();
const QString elementName = stream.name().toString();
const QStringRef elementName = stream.name();
switch (token) {
case QXmlStreamReader::StartElement: {
......@@ -294,11 +293,11 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
void QmlProfilerFileReader::loadProfilerDataModel(QXmlStreamReader &stream)
{
QTC_ASSERT(stream.name().toString() == _("profilerDataModel"), return);
QTC_ASSERT(stream.name() == _("profilerDataModel"), return);
while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext();
const QString elementName = stream.name().toString();
const QStringRef elementName = stream.name();
switch (token) {
case QXmlStreamReader::StartElement: {
......
......@@ -354,7 +354,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream)
while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext();
QString elementName = stream.name().toString();
const QStringRef elementName = stream.name();
switch (token) {
case QXmlStreamReader::StartDocument : continue;
case QXmlStreamReader::StartElement : {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment