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() );
|
return colorForPartition( partition, index.row() );
|
||||||
else
|
else
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
case SizeRole:
|
||||||
|
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,13 @@ public:
|
|||||||
PartitionModel* m_model;
|
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
|
enum Column
|
||||||
{
|
{
|
||||||
NameColumn,
|
NameColumn,
|
||||||
|
Loading…
Reference in New Issue
Block a user