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

@@ -471,18 +471,13 @@ void QmlProfilerTool::setButtonsEnabled(bool enable)
d->m_recordFeaturesMenu->setEnabled(enable);
}
void QmlProfilerTool::createTextMarks()
void QmlProfilerTool::createInitialTextMarks()
{
QmlProfilerTextMarkModel *model = d->m_profilerModelManager->textMarkModel();
foreach (IDocument *document, DocumentModel::openedDocuments())
model->createMarks(d->m_viewContainer, document->filePath().toString());
}
void QmlProfilerTool::clearTextMarks()
{
d->m_profilerModelManager->textMarkModel()->clear();
}
bool QmlProfilerTool::prepareTool()
{
if (d->m_profilerState->clientRecording()) {
@@ -757,14 +752,13 @@ void QmlProfilerTool::initialize()
void QmlProfilerTool::finalize()
{
updateTimeDisplay();
createTextMarks();
createInitialTextMarks();
setButtonsEnabled(true);
d->m_recordButton->setEnabled(true);
}
void QmlProfilerTool::clear()
{
clearTextMarks();
clearDisplay();
setButtonsEnabled(true);
d->m_recordButton->setEnabled(true);