New role for PartitionModel: SizeRole

main
Aurélien Gâteau 11 years ago
parent 5fc07aad7c
commit 93cb9fd426

@ -172,6 +172,8 @@ PartitionModel::data( const QModelIndex& index, int role ) const
return colorForPartition( partition, index.row() );
else
return QVariant();
case SizeRole:
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
default:
return QVariant();
}

@ -46,6 +46,13 @@ public:
PartitionModel* m_model;
};
enum
{
// The raw size, as a qlonglong. This is different from the DisplayRole of
// SizeColumn, which is a human-readable string.
SizeRole = Qt::UserRole + 1
};
enum Column
{
NameColumn,

Loading…
Cancel
Save