diff options
Diffstat (limited to 'Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp')
| -rw-r--r-- | Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp b/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp index b073017..eddace9 100644 --- a/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp +++ b/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | /* | 7 | /* |
| 8 | * Copyright (c) 2016 Isode Limited. | 8 | * Copyright (c) 2016-2018 Isode Limited. |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * See the COPYING file for more information. | 10 | * See the COPYING file for more information. |
| 11 | */ | 11 | */ |
| @@ -18,13 +18,13 @@ | |||
| 18 | 18 | ||
| 19 | namespace Swift { | 19 | namespace Swift { |
| 20 | 20 | ||
| 21 | FileTransferProgressInfo::FileTransferProgressInfo(boost::uintmax_t completeBytes) : completeBytes(completeBytes), completedBytes(0), percentage(0) { | 21 | FileTransferProgressInfo::FileTransferProgressInfo(size_t completeBytes) : completeBytes(completeBytes), completedBytes(0), percentage(0) { |
| 22 | onProgressPercentage(0); | 22 | onProgressPercentage(0); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void FileTransferProgressInfo::setBytesProcessed(int processedBytes) { | 25 | void FileTransferProgressInfo::setBytesProcessed(size_t processedBytes) { |
| 26 | int oldPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); | 26 | int oldPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); |
| 27 | completedBytes += boost::numeric_cast<boost::uintmax_t>(processedBytes); | 27 | completedBytes += processedBytes; |
| 28 | int newPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); | 28 | int newPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); |
| 29 | if (oldPercentage != newPercentage) { | 29 | if (oldPercentage != newPercentage) { |
| 30 | onProgressPercentage(newPercentage); | 30 | onProgressPercentage(newPercentage); |
Swift