Rolled up sample download progress only reflects selected items

This commit is contained in:
Bill Somerville 2021-02-18 13:48:44 +00:00
parent ddbf37cbd2
commit 232773c582
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
1 changed files with 6 additions and 5 deletions

View File

@ -296,14 +296,15 @@ void Directory::update (QTreeWidgetItem * item)
int counted {0};
// get the count, progress and size of children
int items {recurse_children (item, &counted, &bytes, &max)};
// int items {recurse_children (item, &counted, &bytes, &max)};
recurse_children (item, &counted, &bytes, &max);
// estimate size of items not yet downloaded as average of
// those actually present
if (counted)
{
max += (items - counted) * max / counted;
}
// if (counted)
// {
// max += (items - counted) * max / counted;
// }
// save as our progress
item->setData (1, Qt::UserRole, max);