diff --git a/src/plugins/qmlprofiler/abstracttimelinemodel.h b/src/plugins/qmlprofiler/abstracttimelinemodel.h index a5bff2eefee..8841e844f91 100644 --- a/src/plugins/qmlprofiler/abstracttimelinemodel.h +++ b/src/plugins/qmlprofiler/abstracttimelinemodel.h @@ -101,7 +101,6 @@ public: Q_INVOKABLE virtual int getEventIdForLocation(const QString &filename, int line, int column) const = 0; signals: - void countChanged(); void dataAvailable(); void stateChanged(); void emptyChanged(); diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 7bdadc0a29e..ff7591ea0bc 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -38,9 +38,7 @@ Rectangle { property int singleRowHeight: 30 - property bool dataAvailable: true property int eventCount: 0 - property real progress: 0 property alias selectionLocked : view.selectionLocked signal updateLockButton @@ -88,39 +86,14 @@ Rectangle { Connections { target: qmlProfilerModelProxy - onCountChanged: { - eventCount = qmlProfilerModelProxy.count(); - if (eventCount === 0) - root.clearAll(); - if (eventCount > 1) { - root.progress = Math.min(1.0, - (qmlProfilerModelProxy.lastTimeMark() - - qmlProfilerModelProxy.traceStartTime()) / root.elapsedTime * 1e-9 ); - } else { - root.progress = 0; - } - } onStateChanged: { - switch (qmlProfilerModelProxy.getState()) { - case 0: { + // Clear if model is empty. + if (qmlProfilerModelProxy.getState() === 0) root.clearAll(); - break; - } - case 1: { - root.dataAvailable = false; - break; - } - case 2: { - root.progress = 0.9; // jump to 90% - break; - } - } } onDataAvailable: { view.clearData(); zoomControl.setRange(0,0); - progress = 1.0; - dataAvailable = true; view.visible = true; view.requestPaint(); zoomControl.setRange(qmlProfilerModelProxy.traceStartTime(), @@ -142,7 +115,6 @@ Rectangle { function clearData() { view.clearData(); - dataAvailable = false; appKilled = false; eventCount = 0; hideRangeDetails(); diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index df5dfbc20db..9ead0965b4e 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -148,6 +148,7 @@ public: QVector partialCountWeights; int totalWeight; double progress; + double previousProgress; qint64 estimatedTime; // file to load @@ -227,7 +228,11 @@ void QmlProfilerModelManager::modelProxyCountUpdated(int proxyId, qint64 count, d->progress += d->partialCounts[proxyId] * d->partialCountWeights[proxyId] / d->totalWeight; - emit progressChanged(); + + if (d->progress - d->previousProgress > 0.01) { + d->previousProgress = d->progress; + emit progressChanged(); + } } qint64 QmlProfilerModelManager::estimatedProfilingTime() const @@ -258,7 +263,6 @@ void QmlProfilerModelManager::addQmlEvent(int type, QTC_ASSERT(state() == QmlProfilerDataState::AcquiringData, /**/); d->model->addQmlEvent(type, bindingType, startTime, length, data, location, ndata1, ndata2, ndata3, ndata4, ndata5); - emit countChanged(); } void QmlProfilerModelManager::addV8Event(int depth, const QString &function, const QString &filename, @@ -374,11 +378,11 @@ void QmlProfilerModelManager::clear() for (int i = 0; i < d->partialCounts.count(); i++) d->partialCounts[i] = 0; d->progress = 0; + d->previousProgress = 0; d->model->clear(); d->v8Model->clear(); d->traceTime->clear(); - emit countChanged(); setState(QmlProfilerDataState::Empty); } diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h index 8920ec0adeb..1c76756d66a 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h @@ -123,7 +123,6 @@ public: qint64 estimatedProfilingTime() const; signals: - void countChanged(); void error(const QString &error); void stateChanged(); void progressChanged(); diff --git a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp index 73d20cf7add..4d584ba906d 100644 --- a/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerpainteventsmodelproxy.cpp @@ -158,8 +158,6 @@ void PaintEventsModelProxy::loadData() d->computeNesting(); m_modelManager->modelProxyCountUpdated(m_modelId, 1, 1); - - emit countChanged(); } /////////////////// QML interface diff --git a/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp b/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp index c6eb7f10380..f7287c4b052 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp @@ -94,7 +94,6 @@ QmlProfilerStateWidget::QmlProfilerStateWidget(QmlProfilerStateManager *stateMan // profiler state d->m_modelManager = modelManager; connect(d->m_modelManager,SIGNAL(stateChanged()), this, SLOT(dataStateChanged())); - connect(d->m_modelManager,SIGNAL(countChanged()), this, SLOT(dataStateChanged())); connect(d->m_modelManager,SIGNAL(progressChanged()), this, SLOT(dataStateChanged())); connect(this, SIGNAL(newTimeEstimation(qint64)), d->m_modelManager, SLOT(newTimeEstimation(qint64))); d->m_profilerState = stateManager; diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp index de14ba8d9ab..93441580703 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp @@ -194,8 +194,6 @@ void BasicTimelineModel::loadData() d->computeRowStarts(); m_modelManager->modelProxyCountUpdated(m_modelId, 1, 1); - - emit countChanged(); } void BasicTimelineModel::BasicTimelineModelPrivate::computeNestingContracted() diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp index 17cd1d21b62..03fd7b5bba8 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.cpp +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.cpp @@ -66,7 +66,6 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana { d->modelManager = modelManager; connect(modelManager,SIGNAL(stateChanged()),this,SLOT(dataChanged())); - connect(modelManager,SIGNAL(countChanged()),this,SIGNAL(countChanged())); connect(modelManager,SIGNAL(dataAvailable()),this,SIGNAL(dataAvailable())); // external models pushed on top @@ -90,7 +89,6 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana void TimelineModelAggregator::addModel(AbstractTimelineModel *m) { d->modelList << m; - connect(m,SIGNAL(countChanged()),this,SIGNAL(countChanged())); connect(m,SIGNAL(emptyChanged()),this,SIGNAL(emptyChanged())); connect(m,SIGNAL(expandedChanged()),this,SIGNAL(expandedChanged())); connect(m,SIGNAL(stateChanged()),this,SIGNAL(stateChanged())); diff --git a/src/plugins/qmlprofiler/timelinemodelaggregator.h b/src/plugins/qmlprofiler/timelinemodelaggregator.h index 3151ac96a04..472d047bc3f 100644 --- a/src/plugins/qmlprofiler/timelinemodelaggregator.h +++ b/src/plugins/qmlprofiler/timelinemodelaggregator.h @@ -102,7 +102,6 @@ public: Q_INVOKABLE int correctedCategoryIndexForModel(int modelIndex, int absoluteCategoryIndex) const; signals: - void countChanged(); void dataAvailable(); void stateChanged(); void emptyChanged();