QmlProfiler: Keep text marks when replaying events

The text marks are conceptually part of the type storage, not the event
storage. We need to hide them on initialize and show them again on
finalize, though, so that they get updated.

Task-number: QTCREATORBUG-20506
Change-Id: I5fe50110b99ea81b9a7585758a30fcad98bfcaa3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-29 18:04:07 +02:00
parent fe09fc239c
commit 5e66f834e3
6 changed files with 33 additions and 10 deletions

View File

@@ -202,12 +202,24 @@ void QmlProfilerModelManager::replayQmlEvents(QmlEventLoader loader,
}
}
void QmlProfilerModelManager::initialize()
{
d->textMarkModel->hideTextMarks();
TimelineTraceManager::initialize();
}
void QmlProfilerModelManager::clearEventStorage()
{
TimelineTraceManager::clearEventStorage();
emit traceChanged();
}
void QmlProfilerModelManager::clearTypeStorage()
{
d->textMarkModel->clear();
TimelineTraceManager::clearTypeStorage();
}
static QString getDisplayName(const QmlEventType &event)
{
if (event.location().filename().isEmpty()) {
@@ -261,6 +273,7 @@ void QmlProfilerModelManager::finalize()
// which happens on stateChanged(Done).
TimelineTraceManager::finalize();
d->textMarkModel->showTextMarks();
emit traceChanged();
}