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

View File

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