PartitionModel: Add IsFreeSpaceRole

This commit is contained in:
Aurélien Gâteau 2014-07-29 15:56:00 +02:00
parent 0ea6f1698b
commit fe9e52ee0e
2 changed files with 4 additions and 1 deletions

View File

@ -174,6 +174,8 @@ PartitionModel::data( const QModelIndex& index, int role ) const
return QVariant();
case SizeRole:
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
case IsFreeSpaceRole:
return PMUtils::isPartitionFreeSpace( partition );
default:
return QVariant();
}

View File

@ -50,7 +50,8 @@ public:
{
// The raw size, as a qlonglong. This is different from the DisplayRole of
// SizeColumn, which is a human-readable string.
SizeRole = Qt::UserRole + 1
SizeRole = Qt::UserRole + 1,
IsFreeSpaceRole
};
enum Column