New role for PartitionModel: SizeRole
This commit is contained in:
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…
Reference in New Issue
Block a user