[partition] Reduce warnings (Clang, FreeBSD)

- remove unused this captures from lambda
- rename variables that are short, cryptic, and shadowed
- remove documentation for parameters that don't exist
This commit is contained in:
Adriaan de Groot 2020-10-31 23:16:48 +01:00
parent 8bfc4dfcd2
commit 0a44ce381e

View File

@ -906,7 +906,9 @@ ChoicePage::updateDeviceStatePreview()
m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::SingleSelection ); m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::SingleSelection );
m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::SingleSelection ); m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::SingleSelection );
break; break;
default: case InstallChoice::NoChoice:
case InstallChoice::Erase:
case InstallChoice::Manual:
m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::NoSelection ); m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::NoSelection );
m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::NoSelection ); m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::NoSelection );
} }
@ -990,7 +992,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
m_previewAfterFrame->show(); m_previewAfterFrame->show();
m_previewAfterLabel->show(); m_previewAfterLabel->show();
SelectionFilter filter = [this]( const QModelIndex& index ) { SelectionFilter filter = []( const QModelIndex& index ) {
return PartUtils::canBeResized( return PartUtils::canBeResized(
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) ); static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) );
}; };
@ -1079,7 +1081,7 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
} }
else else
{ {
SelectionFilter filter = [this]( const QModelIndex& index ) { SelectionFilter filter = []( const QModelIndex& index ) {
return PartUtils::canBeReplaced( return PartUtils::canBeReplaced(
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) ); static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) );
}; };
@ -1125,7 +1127,9 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
case InstallChoice::Alongside: case InstallChoice::Alongside:
previewSelectionMode = QAbstractItemView::SingleSelection; previewSelectionMode = QAbstractItemView::SingleSelection;
break; break;
default: case InstallChoice::NoChoice:
case InstallChoice::Erase:
case InstallChoice::Manual:
previewSelectionMode = QAbstractItemView::NoSelection; previewSelectionMode = QAbstractItemView::NoSelection;
} }
@ -1179,15 +1183,15 @@ ChoicePage::setupEfiSystemPartitionSelector()
QComboBox* QComboBox*
ChoicePage::createBootloaderComboBox( QWidget* parent ) ChoicePage::createBootloaderComboBox( QWidget* parent )
{ {
QComboBox* bcb = new QComboBox( parent ); QComboBox* comboForBootloader = new QComboBox( parent );
bcb->setModel( m_core->bootLoaderModel() ); comboForBootloader->setModel( m_core->bootLoaderModel() );
// When the chosen bootloader device changes, we update the choice in the PCM // When the chosen bootloader device changes, we update the choice in the PCM
connect( bcb, QOverload< int >::of( &QComboBox::currentIndexChanged ), this, [this]( int newIndex ) { connect( comboForBootloader, QOverload< int >::of( &QComboBox::currentIndexChanged ), this, [this]( int newIndex ) {
QComboBox* bcb = qobject_cast< QComboBox* >( sender() ); QComboBox* bootloaderCombo = qobject_cast< QComboBox* >( sender() );
if ( bcb ) if ( bootloaderCombo )
{ {
QVariant var = bcb->itemData( newIndex, BootLoaderModel::BootLoaderPathRole ); QVariant var = bootloaderCombo->itemData( newIndex, BootLoaderModel::BootLoaderPathRole );
if ( !var.isValid() ) if ( !var.isValid() )
{ {
return; return;
@ -1196,7 +1200,7 @@ ChoicePage::createBootloaderComboBox( QWidget* parent )
} }
} ); } );
return bcb; return comboForBootloader;
} }
@ -1220,7 +1224,6 @@ operator<<( QDebug& s, PartitionIterator& it )
* @brief ChoicePage::setupActions happens every time a new Device* is selected in the * @brief ChoicePage::setupActions happens every time a new Device* is selected in the
* device picker. Sets up the text and visibility of the partitioning actions based * device picker. Sets up the text and visibility of the partitioning actions based
* on the currently selected Device*, bootloader and os-prober output. * on the currently selected Device*, bootloader and os-prober output.
* @param currentDevice
*/ */
void void
ChoicePage::setupActions() ChoicePage::setupActions()