diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-31 17:52:15 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-09-01 10:17:12 +0000 |
commit | 599c5a034af0aa1f786e379cbaba67d2e3e3c8fa (patch) | |
tree | 7a9c03f960f292e10d0552594df6998f3c99af2f /src/plugins/qmlprofiler/qmlprofilertracefile.cpp | |
parent | 0a3435247359f77ec3644d8e3165371959db0a88 (diff) |
QmlProfiler: Avoid overflowing the progress range when loading
The ProgressManager can only deal with at most (1 << 31) / 100.
Change-Id: I03c61839fa5b9dab56b99f98a63ed7ab8b340c09
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertracefile.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertracefile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp index c4cd31cf40..fc6888532b 100644 --- a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp @@ -139,7 +139,7 @@ void QmlProfilerFileReader::setFuture(QFutureInterface<void> *future) bool QmlProfilerFileReader::load(QIODevice *device) { if (m_future) { - m_future->setProgressRange(0, qMin(device->size(), qint64(INT_MAX))); + m_future->setProgressRange(0, 1000); m_future->setProgressValue(0); } @@ -474,7 +474,7 @@ void QmlProfilerFileReader::progress(QIODevice *device) if (!m_future) return; - m_future->setProgressValue(qMin(device->pos(), qint64(INT_MAX))); + m_future->setProgressValue(device->pos() * 1000 / device->size()); } bool QmlProfilerFileReader::isCanceled() const |