Hide from labels view short instances of free space.
This commit is contained in:
parent
3732f3e5b2
commit
43c67310db
@ -154,6 +154,15 @@ PartitionLabelsView::getIndexesToDraw( const QModelIndex& parent ) const
|
|||||||
for ( int row = 0; row < modl->rowCount( parent ); ++row )
|
for ( int row = 0; row < modl->rowCount( parent ); ++row )
|
||||||
{
|
{
|
||||||
QModelIndex index = modl->index( row, 0, parent );
|
QModelIndex index = modl->index( row, 0, parent );
|
||||||
|
|
||||||
|
//HACK: horrible special casing follows.
|
||||||
|
// To save vertical space, we choose to hide short instances of free space.
|
||||||
|
// Arbitrary limit: 10MB.
|
||||||
|
const qint64 maxHiddenB = 10'000'000;
|
||||||
|
if ( index.data( PartitionModel::IsFreeSpaceRole ).toBool() &&
|
||||||
|
index.data( PartitionModel::SizeRole ).toLongLong() < maxHiddenB )
|
||||||
|
continue;
|
||||||
|
|
||||||
list.append( index );
|
list.append( index );
|
||||||
if ( modl->hasChildren( index ) )
|
if ( modl->hasChildren( index ) )
|
||||||
list.append( getIndexesToDraw( index ) );
|
list.append( getIndexesToDraw( index ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user