mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
corrected display of uploaded size
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4325 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3455067373
commit
04d16f2397
@ -1008,12 +1008,16 @@ void TransfersDialog::insertTransfers()
|
||||
pinfo.type = FileProgressInfo::UPLOAD_LINE ;
|
||||
pinfo.nb_chunks = pinfo.cmap._map.empty()?0:nb_chunks ;
|
||||
|
||||
if(filled_chunks > 1) {
|
||||
pinfo.progress = (nb_chunks==0)?0:(filled_chunks*100.0/nb_chunks) ;
|
||||
completed = std::min(info.size,((uint64_t)filled_chunks)*chunk_size) ;
|
||||
if(filled_chunks > 0 && nb_chunks > 0)
|
||||
{
|
||||
pinfo.progress = filled_chunks*100.0/nb_chunks ;
|
||||
completed = std::min(info.size,((uint64_t)filled_chunks)*chunk_size) ; // we use min, because the last chunk might be smaller than chunk_size.
|
||||
}
|
||||
else
|
||||
pinfo.progress = progress ;
|
||||
{
|
||||
completed = pit->transfered % chunk_size ; // use the position with respect to last request.
|
||||
pinfo.progress = (info.size>0)?((pit->transfered % chunk_size)*100.0/info.size):0 ;
|
||||
}
|
||||
|
||||
addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, source,QString::fromStdString(pit->peerId), status, completed, remaining);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user