forked from qt-creator/qt-creator
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 <christian.kandeler@qt.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user