Remember to update total.

This commit is contained in:
Teo Mrnjavac 2016-02-17 16:36:13 +01:00
parent 7bf918bfee
commit 7f6199ad37

View File

@ -527,7 +527,7 @@ PartitionSplitterWidget::computeItemsVector( const QList< PartitionSplitterItem
qreal total = 0; qreal total = 0;
for ( int row = 0; row < originalItems.count(); ++row ) for ( int row = 0; row < originalItems.count(); ++row )
{ {
if ( !originalItems[ row ].children.isEmpty() ) if ( originalItems[ row ].children.isEmpty() )
{ {
items += originalItems[ row ]; items += originalItems[ row ];
total += originalItems[ row ].size; total += originalItems[ row ].size;
@ -535,10 +535,11 @@ PartitionSplitterWidget::computeItemsVector( const QList< PartitionSplitterItem
else else
{ {
PartitionSplitterItem thisItem = originalItems[ row ]; PartitionSplitterItem thisItem = originalItems[ row ];
QPair< QList< PartitionSplitterItem >, qreal > r = computeItemsVector( thisItem.children ); QPair< QList< PartitionSplitterItem >, qreal > pair = computeItemsVector( thisItem.children );
thisItem.children = r.first; thisItem.children = pair.first;
thisItem.size = r.second; thisItem.size = pair.second;
items += thisItem; items += thisItem;
total += thisItem.size;
} }
} }