[partition] Create swap-combo from a set

- Alternate way to create swap-combobox, using configuration
   values rather than an initializer list.
This commit is contained in:
Adriaan de Groot 2018-12-04 11:01:16 +01:00
parent 988a0a5388
commit edc6c64657

View File

@ -194,6 +194,16 @@ createCombo( std::initializer_list< SwapChoice > l )
return box;
}
static inline QComboBox*
createCombo( const QSet< SwapChoice >& s )
{
QComboBox* box = new QComboBox;
for ( SwapChoice c : { SwapChoice::NoSwap, SwapChoice::SmallSwap, SwapChoice::FullSwap, SwapChoice::ReuseSwap, SwapChoice::SwapFile } )
if ( s.contains( c ) )
box->addItem( QString(), c );
return box;
}
/**
* @brief ChoicePage::setupChoices creates PrettyRadioButton objects for the action
* choices.