|
|
|
@ -66,6 +66,9 @@ BootLoaderModel::createMbrItems()
|
|
|
|
|
void
|
|
|
|
|
BootLoaderModel::update()
|
|
|
|
|
{
|
|
|
|
|
clear();
|
|
|
|
|
createMbrItems();
|
|
|
|
|
|
|
|
|
|
QString partitionText;
|
|
|
|
|
Partition* partition = PMUtils::findPartitionByMountPoint( m_devices, "/boot" );
|
|
|
|
|
if ( partition )
|
|
|
|
@ -86,19 +89,25 @@ BootLoaderModel::update()
|
|
|
|
|
{
|
|
|
|
|
if ( lastIsPartition )
|
|
|
|
|
takeRow( rowCount() - 1 );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString mountPoint = PartitionInfo::mountPoint( partition );
|
|
|
|
|
if ( lastIsPartition )
|
|
|
|
|
{
|
|
|
|
|
last->setText( partitionText );
|
|
|
|
|
last->setData( mountPoint, BootLoaderPathRole );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
QString mountPoint = PartitionInfo::mountPoint( partition );
|
|
|
|
|
if ( lastIsPartition )
|
|
|
|
|
{
|
|
|
|
|
last->setText( partitionText );
|
|
|
|
|
last->setData( mountPoint, BootLoaderPathRole );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
appendRow(
|
|
|
|
|
createBootLoaderItem( partitionText, PartitionInfo::mountPoint( partition ), true )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create "don't install bootloader" item
|
|
|
|
|
appendRow(
|
|
|
|
|
createBootLoaderItem( partitionText, PartitionInfo::mountPoint( partition ), true )
|
|
|
|
|
createBootLoaderItem( tr( "Do not install a boot loader" ), QString(), false )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -108,9 +117,14 @@ QVariant
|
|
|
|
|
BootLoaderModel::data( const QModelIndex& index, int role ) const
|
|
|
|
|
{
|
|
|
|
|
if ( role == Qt::DisplayRole )
|
|
|
|
|
{
|
|
|
|
|
if ( QStandardItemModel::data( index, BootLoaderModel::BootLoaderPathRole ).toString().isEmpty() )
|
|
|
|
|
return QStandardItemModel::data( index, Qt::DisplayRole ).toString();
|
|
|
|
|
|
|
|
|
|
return tr( "%1 (%2)" )
|
|
|
|
|
.arg( QStandardItemModel::data( index, Qt::DisplayRole ).toString() )
|
|
|
|
|
.arg( QStandardItemModel::data( index, BootLoaderModel::BootLoaderPathRole ).toString() );
|
|
|
|
|
}
|
|
|
|
|
return QStandardItemModel::data( index, role );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|