mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-04 04:45:36 -04:00
[partition] Remove useless parameter
- previously, updateSwapChoicesTr() wanted to be a static free function, but it needs QObject::tr() ; drop the unnecessary parameter (since it is a member function).
This commit is contained in:
parent
390acd41b2
commit
0be4c38a87
2 changed files with 13 additions and 13 deletions
|
@ -140,7 +140,7 @@ ChoicePage::retranslate()
|
||||||
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
||||||
m_previewAfterLabel->setText( tr( "After:" ) );
|
m_previewAfterLabel->setText( tr( "After:" ) );
|
||||||
|
|
||||||
updateSwapChoicesTr( m_eraseSwapChoiceComboBox );
|
updateSwapChoicesTr();
|
||||||
updateChoiceButtonsTr();
|
updateChoiceButtonsTr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1617,47 +1617,47 @@ ChoicePage::updateNextEnabled()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ChoicePage::updateSwapChoicesTr( QComboBox* box )
|
ChoicePage::updateSwapChoicesTr()
|
||||||
{
|
{
|
||||||
if ( !box )
|
if ( !m_eraseSwapChoiceComboBox )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static_assert( SwapChoice::NoSwap == 0, "Enum values out-of-sync" );
|
static_assert( SwapChoice::NoSwap == 0, "Enum values out-of-sync" );
|
||||||
for ( int index = 0; index < box->count(); ++index )
|
for ( int index = 0; index < m_eraseSwapChoiceComboBox->count(); ++index )
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
switch ( value = box->itemData( index ).toInt( &ok ) )
|
switch ( value = m_eraseSwapChoiceComboBox->itemData( index ).toInt( &ok ) )
|
||||||
{
|
{
|
||||||
// case 0:
|
// case 0:
|
||||||
case SwapChoice::NoSwap:
|
case SwapChoice::NoSwap:
|
||||||
// toInt() returns 0 on failure, so check for ok
|
// toInt() returns 0 on failure, so check for ok
|
||||||
if ( ok ) // It was explicitly set to 0
|
if ( ok ) // It was explicitly set to 0
|
||||||
{
|
{
|
||||||
box->setItemText( index, tr( "No Swap" ) );
|
m_eraseSwapChoiceComboBox->setItemText( index, tr( "No Swap" ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cWarning() << "Box item" << index << box->itemText( index ) << "has non-integer role.";
|
cWarning() << "Box item" << index << m_eraseSwapChoiceComboBox->itemText( index ) << "has non-integer role.";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SwapChoice::ReuseSwap:
|
case SwapChoice::ReuseSwap:
|
||||||
box->setItemText( index, tr( "Reuse Swap" ) );
|
m_eraseSwapChoiceComboBox->setItemText( index, tr( "Reuse Swap" ) );
|
||||||
break;
|
break;
|
||||||
case SwapChoice::SmallSwap:
|
case SwapChoice::SmallSwap:
|
||||||
box->setItemText( index, tr( "Swap (no Hibernate)" ) );
|
m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (no Hibernate)" ) );
|
||||||
break;
|
break;
|
||||||
case SwapChoice::FullSwap:
|
case SwapChoice::FullSwap:
|
||||||
box->setItemText( index, tr( "Swap (with Hibernate)" ) );
|
m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap (with Hibernate)" ) );
|
||||||
break;
|
break;
|
||||||
case SwapChoice::SwapFile:
|
case SwapChoice::SwapFile:
|
||||||
box->setItemText( index, tr( "Swap to file" ) );
|
m_eraseSwapChoiceComboBox->setItemText( index, tr( "Swap to file" ) );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cWarning() << "Box item" << index << box->itemText( index ) << "has role" << value;
|
cWarning() << "Box item" << index << m_eraseSwapChoiceComboBox->itemText( index ) << "has role" << value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ private:
|
||||||
void setupEfiSystemPartitionSelector();
|
void setupEfiSystemPartitionSelector();
|
||||||
|
|
||||||
// Translations support
|
// Translations support
|
||||||
void updateSwapChoicesTr( QComboBox* box );
|
void updateSwapChoicesTr();
|
||||||
void updateChoiceButtonsTr();
|
void updateChoiceButtonsTr();
|
||||||
|
|
||||||
Config* m_config;
|
Config* m_config;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue