mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Experimental: try to enforce a minimum partition size.
This breaks any hope of inline-resizing small partitions.
This commit is contained in:
parent
b3f86925a8
commit
08f9753aa2
1 changed files with 14 additions and 1 deletions
|
@ -474,6 +474,19 @@ PartitionBarsView::computeItemsVector( const QModelIndex& parent ) const
|
||||||
items[ row ] = { size, index };
|
items[ row ] = { size, index };
|
||||||
}
|
}
|
||||||
|
|
||||||
return qMakePair( items, total );
|
// The sizes we have are perfect, but now we have to hardcode a minimum size for small
|
||||||
|
// partitions and compensate for it in the total.
|
||||||
|
qreal adjustedTotal = total;
|
||||||
|
for ( int row = 0; row < count; ++row )
|
||||||
|
{
|
||||||
|
if ( items[ row ].size < 0.01 * total ) // if this item is smaller than 5% of everything
|
||||||
|
{
|
||||||
|
adjustedTotal -= items[ row ].size;
|
||||||
|
items[ row ].size = qRound( 0.01 * total );
|
||||||
|
adjustedTotal += items[ row ].size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return qMakePair( items, adjustedTotal );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue