fixed wrong file count in RsCollectionDialog when downloading files

This commit is contained in:
csoler 2018-03-15 13:11:19 +01:00
parent b3653d1283
commit e1ad21c357
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
2 changed files with 12 additions and 3 deletions

View file

@ -639,8 +639,17 @@ void RsCollectionDialog::directoryLoaded(QString dirLoaded)
*/
void RsCollectionDialog::updateSizes()
{
ui._selectedFiles_TL->setText(QString::number(getRootItem()->data(COLUMN_FILEC,ROLE_SELFILEC).toULongLong())) ;
ui._totalSize_TL->setText(misc::friendlyUnit(getRootItem()->data(COLUMN_SIZE,ROLE_SELSIZE).toULongLong())) ;
uint64_t total_size = 0 ;
uint32_t total_count = 0 ;
for(uint32_t i=0;i<ui._fileEntriesTW->topLevelItemCount();++i)
{
total_size += ui._fileEntriesTW->topLevelItem(i)->data(COLUMN_SIZE ,ROLE_SELSIZE ).toULongLong();
total_count += ui._fileEntriesTW->topLevelItem(i)->data(COLUMN_FILEC,ROLE_SELFILEC).toULongLong();
}
ui._selectedFiles_TL->setText(QString::number(total_count));
ui._totalSize_TL->setText(misc::friendlyUnit(total_size));
}
/**