From aef61a42bc8fa8ac8833d413df6c33565b4a0e77 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Jan 2019 08:22:17 -0500 Subject: [PATCH] [partition] Tidy up code - avoid possible nullptr dereference on connect() if no swap choices - group retranslations together --- src/modules/partition/gui/ChoicePage.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 693f801ce..800418ade 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -276,10 +276,6 @@ ChoicePage::setupChoices() m_itemsLayout->addWidget( m_eraseButton ); m_somethingElseButton = new PrettyRadioButton; - CALAMARES_RETRANSLATE( - m_somethingElseButton->setText( tr( "Manual partitioning
" - "You can create or resize partitions yourself." ) ); - ) m_somethingElseButton->setIconSize( iconSize ); m_somethingElseButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionManual, CalamaresUtils::Original, @@ -317,10 +313,13 @@ ChoicePage::setupChoices() connect( this, &ChoicePage::actionChosen, this, &ChoicePage::onActionChanged ); - connect( m_eraseSwapChoices, QOverload::of(&QComboBox::currentIndexChanged), - this, &ChoicePage::onActionChanged ); + if ( m_eraseSwapChoices ) + connect( m_eraseSwapChoices, QOverload::of(&QComboBox::currentIndexChanged), + this, &ChoicePage::onActionChanged ); CALAMARES_RETRANSLATE( + m_somethingElseButton->setText( tr( "Manual partitioning
" + "You can create or resize partitions yourself." ) ); updateSwapChoicesTr( m_eraseSwapChoices ); ) }