From 1543899795745fde1f3f242b7ffdaa9d05300e3c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 25 Sep 2014 11:32:54 +0200 Subject: [PATCH] Upload Chunking: Fix progress DB values --- src/mirall/propagator_qnam.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp index 10a7a7855..723ff8979 100644 --- a/src/mirall/propagator_qnam.cpp +++ b/src/mirall/propagator_qnam.cpp @@ -442,11 +442,12 @@ void PropagateUploadFileQNAM::slotPutFinished() SyncJournalDb::UploadInfo pi; pi._valid = true; - auto currentChunk = _chunkCount; + auto currentChunk = job->_chunk; foreach (auto *job, _jobs) { + // Take the minimum finished one currentChunk = qMin(currentChunk, job->_chunk); } - pi._chunk = (currentChunk + _startChunk) % _chunkCount; // next chunk to start with + pi._chunk = (currentChunk + _startChunk + 1) % _chunkCount ; // next chunk to start with pi._transferid = _transferId; pi._modtime = Utility::qDateTimeFromTime_t(_item._modtime); _propagator->_journal->setUploadInfo(_item._file, pi);