diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-10-07 22:59:24 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-08 10:54:15 +0200 |
commit | d78fcc4fda3282c3a465ea4b30294aa856dd0147 (patch) | |
tree | 6fb54d12159e2a355a533d26c5893d758cf6ffa9 | |
parent | c14977cc806227bc546043c0d16ede21b856e830 (diff) |
QNX: Fix update progress
The string format can only be converted to a double for very high numbers.
Change-Id: I20e284eb24761dcb11a4777baf37782752b95bb6
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | src/bluetooth/qbluetoothtransferreply_qnx.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bluetooth/qbluetoothtransferreply_qnx.cpp b/src/bluetooth/qbluetoothtransferreply_qnx.cpp index 56e2c3e3..e37852cd 100644 --- a/src/bluetooth/qbluetoothtransferreply_qnx.cpp +++ b/src/bluetooth/qbluetoothtransferreply_qnx.cpp @@ -192,12 +192,16 @@ void QBluetoothTransferReplyQnx::controlEvent(ppsResult result) Q_EMIT finished(this); } else if (result.msg == QStringLiteral("opp_update")) { bool ok; - int sentBytes = result.dat.at(result.dat.indexOf(QStringLiteral("sent")) + 1).toInt(&ok); - if (!ok) + qint64 sentBytes = result.dat.at(result.dat.indexOf(QStringLiteral("sent")) + 1).toDouble(&ok); + if (!ok) { + qWarning() << "Could not convert sent bytes"; return; - int totalBytes = result.dat.at(result.dat.indexOf(QStringLiteral("total")) + 1).toInt(&ok); - if (!ok) + } + qint64 totalBytes = result.dat.at(result.dat.indexOf(QStringLiteral("total")) + 1).toDouble(&ok); + if (!ok) { + qWarning() << "Could not convert total bytes"; return; + } qBBBluetoothDebug() << "opp update" << sentBytes << totalBytes; Q_EMIT transferProgress(sentBytes, totalBytes); } else if (result.msg == QStringLiteral("opp_complete")) { |