QmlProfiler: Drop some unreachable code

The model manager will make sure that the flame graph model doesn't get
any events it doesn't accept.

Change-Id: Ibe6e06c558d138cebe6be5dbc76e8f51e9e1fd95
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-05-31 14:50:16 +02:00
parent 4436a1c7f2
commit 09b1fe3f20
2 changed files with 2 additions and 6 deletions

View File

@@ -51,7 +51,6 @@ FlameGraphModel::FlameGraphModel(QmlProfilerModelManager *modelManager,
this, [this](int typeId, int, int){loadNotes(typeId, true);}); this, [this](int typeId, int, int){loadNotes(typeId, true);});
m_modelId = modelManager->registerModelProxy(); m_modelId = modelManager->registerModelProxy();
m_acceptedTypes << Compiling << Creating << Binding << HandlingSignal << Javascript;
modelManager->announceFeatures(Constants::QML_JS_RANGE_FEATURES, modelManager->announceFeatures(Constants::QML_JS_RANGE_FEATURES,
[this](const QmlEvent &event, const QmlEventType &type) { [this](const QmlEvent &event, const QmlEventType &type) {
loadEvent(event, type); loadEvent(event, type);
@@ -95,8 +94,7 @@ void FlameGraphModel::loadNotes(int typeIndex, bool emitSignal)
void FlameGraphModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void FlameGraphModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
{ {
if (!m_acceptedTypes.contains(type.rangeType)) Q_UNUSED(type);
return;
if (m_stackBottom.children.isEmpty()) if (m_stackBottom.children.isEmpty())
beginResetModel(); beginResetModel();
@@ -132,13 +130,12 @@ void FlameGraphModel::onModelManagerStateChanged()
static QString nameForType(RangeType typeNumber) static QString nameForType(RangeType typeNumber)
{ {
switch (typeNumber) { switch (typeNumber) {
case Painting: return FlameGraphModel::tr("Paint");
case Compiling: return FlameGraphModel::tr("Compile"); case Compiling: return FlameGraphModel::tr("Compile");
case Creating: return FlameGraphModel::tr("Create"); case Creating: return FlameGraphModel::tr("Create");
case Binding: return FlameGraphModel::tr("Binding"); case Binding: return FlameGraphModel::tr("Binding");
case HandlingSignal: return FlameGraphModel::tr("Signal"); case HandlingSignal: return FlameGraphModel::tr("Signal");
case Javascript: return FlameGraphModel::tr("JavaScript"); case Javascript: return FlameGraphModel::tr("JavaScript");
default: return QString(); default: Q_UNREACHABLE();
} }
} }

View File

@@ -108,7 +108,6 @@ private:
int m_modelId; int m_modelId;
QmlProfilerModelManager *m_modelManager; QmlProfilerModelManager *m_modelManager;
QList<RangeType> m_acceptedTypes;
QSet<int> m_typeIdsWithNotes; QSet<int> m_typeIdsWithNotes;
}; };