[partition] Don't show capacity of new LVM VGs in DeviceModel.

This commit is contained in:
Caio 2018-06-07 17:49:25 -03:00
parent 208d58bcd9
commit e5351cdf3c

View File

@ -79,10 +79,18 @@ DeviceModel::data( const QModelIndex& index, int role ) const
if ( device->name().isEmpty() )
return device->deviceNode();
else
{
if ( device->capacity() != 1 )
return tr( "%1 - %2 (%3)" )
.arg( device->name() )
.arg( KFormat().formatByteSize( device->capacity() ) )
.arg( device->deviceNode() );
// Newly LVM VGs don't have capacity property yet (i.e. always has 1B capacity), so don't show it for a while
else
return tr( "%1 - (%2)" )
.arg( device->name() )
.arg( device->deviceNode() );
}
case Qt::DecorationRole:
return CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionDisk,
CalamaresUtils::Original,