summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2013-12-09 12:11:48 +0100
committerUlf Hermann <ulf.hermann@digia.com>2013-12-11 17:28:30 +0100
commit5c7509dd0930f71197278b9709f89d359be8bf84 (patch)
tree593bc6f37401cee35e2123c23bb15f2a51bfa571 /src/plugins
parent210e780cc381c033088c0b7286102be15c065f90 (diff)
downloadqt-creator-5c7509dd0930f71197278b9709f89d359be8bf84.tar.gz
QmlProfiler: Add another data state "ClearingData"
This allows us to steer the timeline models in a more fine grained way and avoid duplicate processing of the same data. We don't need to rebuild everything on stateChanged of the model manager then. Task-number: QTCREATORBUG-10950 Change-Id: I2aa9a96a33c602f062fc3b644ac06280ba7cd45a Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmlprofiler/abstracttimelinemodel.cpp3
-rw-r--r--src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp4
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.h1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.cpp3
6 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/qmlprofiler/abstracttimelinemodel.cpp b/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
index ae5972cebd..35b59e2172 100644
--- a/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
+++ b/src/plugins/qmlprofiler/abstracttimelinemodel.cpp
@@ -41,7 +41,6 @@ void AbstractTimelineModel::setModelManager(QmlProfilerModelManager *modelManage
{
m_modelManager = modelManager;
connect(modelManager->simpleModel(),SIGNAL(changed()),this,SLOT(dataChanged()));
- connect(modelManager,SIGNAL(stateChanged()),this,SLOT(dataChanged()));
m_modelId = modelManager->registerModelProxy();
}
@@ -85,7 +84,7 @@ void AbstractTimelineModel::dataChanged()
case QmlProfilerDataState::ProcessingData:
loadData();
break;
- case QmlProfilerDataState::Empty:
+ case QmlProfilerDataState::ClearingData:
clear();
break;
default:
diff --git a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp
index d1be7cfdb3..1771091e92 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp
@@ -99,7 +99,7 @@ void QmlProfilerEventsModelProxy::dataChanged()
if (d->modelManager->state() == QmlProfilerDataState::ProcessingData)
loadData();
- if (d->modelManager->state() == QmlProfilerDataState::Empty)
+ if (d->modelManager->state() == QmlProfilerDataState::ClearingData)
clear();
}
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 82af434a31..6fd51ef788 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -57,6 +57,9 @@ void QmlProfilerDataState::setState(QmlProfilerDataState::State state)
return;
switch (state) {
+ case ClearingData:
+ QTC_ASSERT(m_state == Done || m_state == Empty, /**/);
+ break;
case Empty:
// if it's not empty, complain but go on
QTC_ASSERT(m_modelManager->isEmpty(), /**/);
@@ -345,6 +348,7 @@ QmlProfilerDataState::State QmlProfilerModelManager::state() const
void QmlProfilerModelManager::clear()
{
+ setState(QmlProfilerDataState::ClearingData);
for (int i = 0; i < d->partialCounts.count(); i++)
d->partialCounts[i] = 0;
d->progress = 0;
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
index f814ec432c..6b48e82a4d 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
@@ -52,6 +52,7 @@ public:
Empty,
AcquiringData,
ProcessingData,
+ ClearingData,
Done
};
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 2f4afa09d7..555d5572e3 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -522,6 +522,8 @@ void QmlProfilerTool::profilerDataModelStateChanged()
{
switch (d->m_profilerModelManager->state()) {
case QmlProfilerDataState::Empty :
+ break;
+ case QmlProfilerDataState::ClearingData :
clearDisplay();
break;
case QmlProfilerDataState::AcquiringData :
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
index 395be21696..baa674bb8d 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
@@ -474,7 +474,8 @@ void QmlProfilerTraceView::setAppKilled()
void QmlProfilerTraceView::profilerDataModelStateChanged()
{
switch (d->m_modelManager->state()) {
- case QmlProfilerDataState::Empty:
+ case QmlProfilerDataState::Empty: break;
+ case QmlProfilerDataState::ClearingData:
emit enableToolbar(false);
break;
case QmlProfilerDataState::AcquiringData: break;