Make the Create Partition dialog obey the default FS type setting.

This commit is contained in:
Teo Mrnjavac 2016-06-10 15:37:11 +02:00
parent a00ebc01e7
commit 395fb340b7

View File

@ -77,11 +77,23 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
initGptPartitionTypeUi();
// File system
FileSystem::Type defaultFsType = FileSystem::typeForName(
Calamares::JobQueue::instance()->
globalStorage()->
value( "defaultFileSystemType" ).toString() );
int defaultFsIndex = -1;
int fsCounter = 0;
QStringList fsNames;
for ( auto fs : FileSystemFactory::map() )
{
if ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended )
if ( fs->supportCreate() != FileSystem::cmdSupportNone &&
fs->type() != FileSystem::Extended )
{
fsNames << fs->name();
if ( fs->type() == defaultFsType )
defaultFsIndex = fsCounter;
fsCounter++;
}
}
m_ui->fsComboBox->addItems( fsNames );
@ -89,6 +101,9 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
connect( m_ui->fsComboBox, SIGNAL( activated( int ) ), SLOT( updateMountPointUi() ) );
connect( m_ui->extendedRadioButton, SIGNAL( toggled( bool ) ), SLOT( updateMountPointUi() ) );
// Select a default
m_ui->fsComboBox->setCurrentIndex( defaultFsIndex );
setupFlagsList();
}