diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml index d3f572ff2d7..c51c24c0f2b 100644 --- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml +++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml @@ -64,9 +64,8 @@ Item { var extdesc=[]; var labelList = qmlProfilerModelProxy.getLabels(modelIndex); for (var i = 0; i < labelList.length; i++ ) { - desc[i] = labelList[i].description; + extdesc[i] = desc[i] = (labelList[i].description || qsTr("")); ids[i] = labelList[i].id; - extdesc[i] = labelList[i].description; if (labelList[i].displayName !== undefined) extdesc[i] += " (" + labelList[i].displayName + ")"; } diff --git a/src/plugins/qmlprofiler/qml/RangeDetails.qml b/src/plugins/qmlprofiler/qml/RangeDetails.qml index e1627036927..b5bbf4af8b1 100644 --- a/src/plugins/qmlprofiler/qml/RangeDetails.qml +++ b/src/plugins/qmlprofiler/qml/RangeDetails.qml @@ -68,8 +68,10 @@ Item { rangeDetails.dialogTitle = eventData[0]["title"]; for (var i = 1; i < eventData.length; i++) { for (var k in eventData[i]) { - eventInfo.append({"content" : k}); - eventInfo.append({"content" : eventData[i][k]}) + if (eventData[i][k].length > 0) { + eventInfo.append({"content" : k}); + eventInfo.append({"content" : eventData[i][k]}); + } } } rangeDetails.visible = true; diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp index 9a8e80113d5..92dc82959da 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp @@ -69,10 +69,7 @@ QString getDisplayName(const QmlProfilerDataModel::QmlEventTypeData &event) const QmlDebug::QmlEventLocation eventLocation = getLocation(event); QString displayName; - // generate hash - if (eventLocation.filename.isEmpty()) { - displayName = QmlProfilerDataModel::tr(""); - } else { + if (!eventLocation.filename.isEmpty()) { const QString filePath = QUrl(eventLocation.filename).path(); displayName = filePath.mid(filePath.lastIndexOf(QLatin1Char('/')) + 1) + QLatin1Char(':') + QString::number(eventLocation.line); diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.cpp b/src/plugins/qmlprofiler/qmlprofilereventview.cpp index 813beaa3bcf..d4bb588478f 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilereventview.cpp @@ -580,7 +580,8 @@ void QmlProfilerEventsMainView::parseModelProxy() QList newRow; if (d->m_fieldShown[Name]) - newRow << new EventsViewItem(event.displayName); + newRow << new EventsViewItem(event.displayName.isEmpty() ? tr("") : + event.displayName); if (d->m_fieldShown[Type]) { QString typeString = QmlProfilerEventsMainView::nameForType(event.rangeType); @@ -637,7 +638,8 @@ void QmlProfilerEventsMainView::parseModelProxy() } if (d->m_fieldShown[Details]) { - newRow << new EventsViewItem(event.data); + newRow << new EventsViewItem(event.data.isEmpty() ? tr("Source code not available") : + event.data); newRow.last()->setData(QVariant(event.data)); } @@ -894,11 +896,13 @@ void QmlProfilerEventRelativesView::rebuildTree( // ToDo: here we were going to search for the data in the other modelproxy // maybe we should store the data in this proxy and get it here // no indirections at this level of abstraction! - newRow << new EventsViewItem(type.displayName); + newRow << new EventsViewItem(type.displayName.isEmpty() ? tr("") : + type.displayName); newRow << new EventsViewItem(QmlProfilerEventsMainView::nameForType(type.rangeType)); newRow << new EventsViewItem(QmlProfilerBaseModel::formatTime(event.duration)); newRow << new EventsViewItem(QString::number(event.calls)); - newRow << new EventsViewItem(type.data); + newRow << new EventsViewItem(type.data.isEmpty() ? tr("Source code not available") : + type.data); newRow.at(0)->setData(QVariant(typeIndex), EventTypeIndexRole); newRow.at(2)->setData(QVariant(event.duration));