Add IsNewPartition role

This commit is contained in:
Aurélien Gâteau 2014-07-15 17:33:16 +02:00
parent fa30fe147f
commit 174114f09c
2 changed files with 8 additions and 1 deletions

View File

@ -92,7 +92,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const
return prefix + tr( "Free Space" );
else
{
return prefix + ( partition->partitionPath().isEmpty()
return prefix + ( PMUtils::isPartitionNew( partition )
? tr( "New partition" )
: partition->partitionPath() );
}
@ -112,6 +112,8 @@ PartitionModel::data( const QModelIndex& index, int role ) const
cDebug() << "Unknown column" << col;
return QVariant();
}
case IsNewPartitionRole:
return PMUtils::isPartitionNew( partition );
default:
return QVariant();
}

View File

@ -46,6 +46,11 @@ public:
LastColumn = SizeColumn + 1
};
enum
{
IsNewPartitionRole = Qt::UserRole
};
PartitionModel( QObject* parent = 0 );
/**
* device and infoForPartitions must remain alive for the life of