QmlProfiler: Deduplicate dataChanged() slot in timeline models.

The same code was repeated all over the place.

Change-Id: I70a8caa46c91a7b55fd7eecac32cdc53b5d94cfb
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2013-12-09 12:16:58 +01:00
parent d9bb54b7c8
commit 210e780cc3
6 changed files with 26 additions and 32 deletions

View File

@@ -79,5 +79,24 @@ int AbstractTimelineModel::getBindingLoopDest(int index) const
return -1;
}
void AbstractTimelineModel::dataChanged()
{
switch (m_modelManager->state()) {
case QmlProfilerDataState::ProcessingData:
loadData();
break;
case QmlProfilerDataState::Empty:
clear();
break;
default:
break;
}
emit stateChanged();
emit dataAvailable();
emit emptyChanged();
emit expandedChanged();
}
}