QmlProfiler: Set the future to finished after loading all events

Change-Id: I9b23eb5a10558279a47b9bcc106430d5c2b802e0
Task-number: QTCREATORBUG-20508
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-28 16:40:36 +02:00
parent bfb3764328
commit 0f3409bf3f
3 changed files with 11 additions and 0 deletions

View File

@@ -67,6 +67,11 @@ void TimelineTraceFile::fail(const QString &message)
m_future.cancel();
}
void TimelineTraceFile::finish()
{
m_future.reportFinished();
}
bool TimelineTraceFile::isCanceled() const
{
return m_future.isCanceled();

View File

@@ -64,7 +64,9 @@ public:
virtual void save(QIODevice *device) = 0;
virtual void load(QIODevice *device) = 0;
void fail(const QString &message);
void finish();
void setTraceStart(qint64 traceStart) { m_traceStart = traceStart; }
qint64 traceStart() const { return m_traceStart; }

View File

@@ -191,6 +191,8 @@ void QmlProfilerTraceFile::loadQtd(QIODevice *device)
if (stream.hasError())
fail(tr("Error while parsing trace data file: %1").arg(stream.errorString()));
else
finish();
}
void QmlProfilerTraceFile::loadQzt(QIODevice *device)
@@ -285,6 +287,8 @@ void QmlProfilerTraceFile::loadQzt(QIODevice *device)
buffer.close();
setDeviceProgress(device);
}
finish();
}
void QmlProfilerTraceFile::addEventsProgress(qint64 timestamp)