forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user