From 995cb365c4a6017539d3c532aa5c9203b0289625 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 19 May 2014 23:35:38 +0300 Subject: [PATCH] QmlProfiler: Avoid repetitive calls Change-Id: Iaf84cccf864b3975e6f6fe282a97fb5ea70e7a93 Reviewed-by: Ulf Hermann --- src/plugins/qmlprofiler/qv8profilereventview.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmlprofiler/qv8profilereventview.cpp b/src/plugins/qmlprofiler/qv8profilereventview.cpp index 0ab78cb01e1..319d007a7d1 100644 --- a/src/plugins/qmlprofiler/qv8profilereventview.cpp +++ b/src/plugins/qmlprofiler/qv8profilereventview.cpp @@ -469,11 +469,12 @@ void QV8ProfilerEventsMainView::QV8ProfilerEventsMainViewPrivate::buildV8ModelFr item->setEditable(false); // metadata - newRow.at(0)->setData(QString::fromLatin1("%1:%2").arg(v8event->filename, QString::number(v8event->line)), EventHashStrRole); - newRow.at(0)->setData(QVariant(v8event->filename), FilenameRole); - newRow.at(0)->setData(QVariant(v8event->line), LineRole); - newRow.at(0)->setData(QVariant(-1),ColumnRole); // v8 events have no column info - newRow.at(0)->setData(QVariant(v8event->eventId), EventIdRole); + QStandardItem *firstItem = newRow.at(0); + firstItem->setData(QString::fromLatin1("%1:%2").arg(v8event->filename, QString::number(v8event->line)), EventHashStrRole); + firstItem->setData(QVariant(v8event->filename), FilenameRole); + firstItem->setData(QVariant(v8event->line), LineRole); + firstItem->setData(QVariant(-1),ColumnRole); // v8 events have no column info + firstItem->setData(QVariant(v8event->eventId), EventIdRole); // append m_model->invisibleRootItem()->appendRow(newRow);