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) ...@@ -136,15 +136,14 @@ bool QmlProfilerFileReader::load(QIODevice *device)
while (validVersion && !stream.atEnd() && !stream.hasError()) { while (validVersion && !stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext(); QXmlStreamReader::TokenType token = stream.readNext();
QString elementName = stream.name().toString(); const QStringRef elementName = stream.name();
switch (token) { switch (token) {
case QXmlStreamReader::StartDocument : continue; case QXmlStreamReader::StartDocument : continue;
case QXmlStreamReader::StartElement : { case QXmlStreamReader::StartElement : {
if (elementName == _("trace")) { if (elementName == _("trace")) {
QXmlStreamAttributes attributes = stream.attributes(); QXmlStreamAttributes attributes = stream.attributes();
if (attributes.hasAttribute(_("version"))) if (attributes.hasAttribute(_("version")))
validVersion = attributes.value(_("version")).toString() validVersion = attributes.value(_("version")) == _(PROFILER_FILE_VERSION);
== _(PROFILER_FILE_VERSION);
else else
validVersion = false; validVersion = false;
if (attributes.hasAttribute(_("traceStart"))) if (attributes.hasAttribute(_("traceStart")))
...@@ -187,7 +186,7 @@ bool QmlProfilerFileReader::load(QIODevice *device) ...@@ -187,7 +186,7 @@ bool QmlProfilerFileReader::load(QIODevice *device)
void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream) void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
{ {
QTC_ASSERT(stream.name().toString() == _("eventData"), return); QTC_ASSERT(stream.name() == _("eventData"), return);
QXmlStreamAttributes attributes = stream.attributes(); QXmlStreamAttributes attributes = stream.attributes();
if (attributes.hasAttribute(_("totalTime"))) { if (attributes.hasAttribute(_("totalTime"))) {
...@@ -208,7 +207,7 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream) ...@@ -208,7 +207,7 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
while (!stream.atEnd() && !stream.hasError()) { while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext(); QXmlStreamReader::TokenType token = stream.readNext();
const QString elementName = stream.name().toString(); const QStringRef elementName = stream.name();
switch (token) { switch (token) {
case QXmlStreamReader::StartElement: { case QXmlStreamReader::StartElement: {
...@@ -294,11 +293,11 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream) ...@@ -294,11 +293,11 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
void QmlProfilerFileReader::loadProfilerDataModel(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()) { while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext(); QXmlStreamReader::TokenType token = stream.readNext();
const QString elementName = stream.name().toString(); const QStringRef elementName = stream.name();
switch (token) { switch (token) {
case QXmlStreamReader::StartElement: { case QXmlStreamReader::StartElement: {
......
...@@ -354,7 +354,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream) ...@@ -354,7 +354,7 @@ void QV8ProfilerDataModel::load(QXmlStreamReader &stream)
while (!stream.atEnd() && !stream.hasError()) { while (!stream.atEnd() && !stream.hasError()) {
QXmlStreamReader::TokenType token = stream.readNext(); QXmlStreamReader::TokenType token = stream.readNext();
QString elementName = stream.name().toString(); const QStringRef elementName = stream.name();
switch (token) { switch (token) {
case QXmlStreamReader::StartDocument : continue; case QXmlStreamReader::StartDocument : continue;
case QXmlStreamReader::StartElement : { 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