diff options
Diffstat (limited to 'Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp')
-rw-r--r-- | Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp b/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp index a2fff03..b073017 100644 --- a/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp +++ b/Swift/Controllers/FileTransfer/FileTransferProgressInfo.cpp @@ -19,21 +19,21 @@ namespace Swift { FileTransferProgressInfo::FileTransferProgressInfo(boost::uintmax_t completeBytes) : completeBytes(completeBytes), completedBytes(0), percentage(0) { - onProgressPercentage(0); + onProgressPercentage(0); } void FileTransferProgressInfo::setBytesProcessed(int processedBytes) { - int oldPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); - completedBytes += boost::numeric_cast<boost::uintmax_t>(processedBytes); - int newPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); - if (oldPercentage != newPercentage) { - onProgressPercentage(newPercentage); - } - percentage = newPercentage; + int oldPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); + completedBytes += boost::numeric_cast<boost::uintmax_t>(processedBytes); + int newPercentage = int(double(completedBytes) / double(completeBytes) * 100.0); + if (oldPercentage != newPercentage) { + onProgressPercentage(newPercentage); + } + percentage = newPercentage; } int FileTransferProgressInfo::getPercentage() const { - return percentage; + return percentage; } } |