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
+6 -5
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);