aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-07-06 11:34:49 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-06 10:26:17 +0000
commitc08862688a097fbd3c2702266499285416420393 (patch)
treee396733cbf0747bfd2dde67815d61bcb567e582b /src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
parentd12c8806ac8f02ad7f9ed741e90fd1c52c5dd3b9 (diff)
QmlProfiler: Avoid reloading notes twice on range restriction
We need to clear them before we restrict as otherwise the other models will end up with invalid notes. Doing that by calling loadData() is inefficient as we need to call the same method again after finalizing, because the timeline models may have changed. Change-Id: I4cd6e13bfb73804aab8f1cfee6db4069a7b808cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 067af444b4..e19df2893e 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -443,6 +443,9 @@ void QmlProfilerModelManager::clear()
void QmlProfilerModelManager::restrictToRange(qint64 startTime, qint64 endTime)
{
d->notesModel->saveData();
+ const QVector<QmlNote> notes = d->notesModel->notes();
+ d->notesModel->clear();
+
setState(ClearingData);
setVisibleFeatures(0);
@@ -450,7 +453,7 @@ void QmlProfilerModelManager::restrictToRange(qint64 startTime, qint64 endTime)
d->model->replayEvents(startTime, endTime,
std::bind(&QmlProfilerModelManager::dispatch, this,
std::placeholders::_1, std::placeholders::_2));
- d->notesModel->loadData();
+ d->notesModel->setNotes(notes);
d->traceTime->restrictToRange(startTime, endTime);
acquiringDone();
}