aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-02-20 19:19:50 +0100
committerUlf Hermann <[email protected]>2017-02-24 11:55:16 +0000
commitbf69eb9467b273357b15b8527bb0189d9841792f (patch)
treef0c2cdc2596ae53c2251342173c62965a445c9d7 /src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
parent1ee8d0fb64b4a7c59fa4601fc8cad41372a8dd19 (diff)
QmlProfiler: Guard against the temporary trace file going away
If we cannot open a temporary file to cache a trace or retrieve a previously cached trace, the QML profiler won't work correctly. Show an error in this case. Change-Id: I468d74d9c33033b9ad19501bccbd69a9fe164fed Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
index 26ecc29401e..b1917134300 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
@@ -120,13 +120,17 @@ void QmlProfilerStatisticsModel::restrictToFeatures(qint64 features)
return;
clear();
- d->modelManager->qmlModel()->replayEvents(d->modelManager->traceTime()->startTime(),
- d->modelManager->traceTime()->endTime(),
- std::bind(&QmlProfilerStatisticsModel::loadEvent,
- this, std::placeholders::_1,
- std::placeholders::_2));
- finalize();
- notesChanged(-1); // Reload notes
+ if (!d->modelManager->qmlModel()->replayEvents(d->modelManager->traceTime()->startTime(),
+ d->modelManager->traceTime()->endTime(),
+ std::bind(&QmlProfilerStatisticsModel::loadEvent,
+ this, std::placeholders::_1,
+ std::placeholders::_2))) {
+ emit d->modelManager->error(tr("Could not re-read events from temporary trace file."));
+ clear();
+ } else {
+ finalize();
+ notesChanged(-1); // Reload notes
+ }
}
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &QmlProfilerStatisticsModel::getData() const