Commit 599c5a03 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Avoid overflowing the progress range when loading



The ProgressManager can only deal with at most (1 << 31) / 100.

Change-Id: I03c61839fa5b9dab56b99f98a63ed7ab8b340c09
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 0a343524
...@@ -139,7 +139,7 @@ void QmlProfilerFileReader::setFuture(QFutureInterface<void> *future) ...@@ -139,7 +139,7 @@ void QmlProfilerFileReader::setFuture(QFutureInterface<void> *future)
bool QmlProfilerFileReader::load(QIODevice *device) bool QmlProfilerFileReader::load(QIODevice *device)
{ {
if (m_future) { if (m_future) {
m_future->setProgressRange(0, qMin(device->size(), qint64(INT_MAX))); m_future->setProgressRange(0, 1000);
m_future->setProgressValue(0); m_future->setProgressValue(0);
} }
...@@ -474,7 +474,7 @@ void QmlProfilerFileReader::progress(QIODevice *device) ...@@ -474,7 +474,7 @@ void QmlProfilerFileReader::progress(QIODevice *device)
if (!m_future) if (!m_future)
return; return;
m_future->setProgressValue(qMin(device->pos(), qint64(INT_MAX))); m_future->setProgressValue(device->pos() * 1000 / device->size());
} }
bool QmlProfilerFileReader::isCanceled() const bool QmlProfilerFileReader::isCanceled() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment