mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -04:00
[packagechooserq] Apply renaming also to distro-visible code
- The distro-visible key is renamed *pkgc* to *packageChoice* - Read *packageChoice* only if there are no items to use
This commit is contained in:
parent
8b703ba6a3
commit
8a49fde016
3 changed files with 27 additions and 18 deletions
|
@ -204,7 +204,6 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
PackageChooserMode::Required );
|
||||
m_method = PackageChooserMethodNames().find( CalamaresUtils::getString( configurationMap, "method" ),
|
||||
PackageChooserMethod::Legacy );
|
||||
setPackageChoice( CalamaresUtils::getString( configurationMap, "pkgc" ) );
|
||||
|
||||
if ( m_method == PackageChooserMethod::Legacy )
|
||||
{
|
||||
|
@ -233,21 +232,25 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
if ( configurationMap.contains( "items" ) )
|
||||
{
|
||||
fillModel( m_model, configurationMap.value( "items" ).toList() );
|
||||
}
|
||||
|
||||
QString default_item_id = CalamaresUtils::getString( configurationMap, "default" );
|
||||
if ( !default_item_id.isEmpty() )
|
||||
{
|
||||
for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n )
|
||||
QString default_item_id = CalamaresUtils::getString( configurationMap, "default" );
|
||||
if ( !default_item_id.isEmpty() )
|
||||
{
|
||||
QModelIndex item_idx = m_model->index( item_n, 0 );
|
||||
QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole );
|
||||
|
||||
if ( item_id.toString() == default_item_id )
|
||||
for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n )
|
||||
{
|
||||
m_defaultModelIndex = item_idx;
|
||||
break;
|
||||
QModelIndex item_idx = m_model->index( item_n, 0 );
|
||||
QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole );
|
||||
|
||||
if ( item_id.toString() == default_item_id )
|
||||
{
|
||||
m_defaultModelIndex = item_idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setPackageChoice( CalamaresUtils::getString( configurationMap, "packageChoice" ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue