[partition] Reduce warnings (Clang, FreeBSD)
The code doesn't match the comment: there are no by-ref captures in the code, and the shadowing of parameters and local variables is confusing. Remove one variable that is passed in as an argument (and just pass the value as argument) and copy-capture the other rather than doing weird argument passing.
This commit is contained in:
parent
0a44ce381e
commit
4d444cbfbb
@ -736,14 +736,12 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This will be deleted by the second lambda, below.
|
||||||
QString* homePartitionPath = new QString();
|
QString* homePartitionPath = new QString();
|
||||||
bool doReuseHomePartition = m_reuseHomeCheckBox->isChecked();
|
|
||||||
|
|
||||||
// NOTE: using by-ref captures because we need to write homePartitionPath and
|
|
||||||
// doReuseHomePartition *after* the device revert, for later use.
|
|
||||||
ScanningDialog::run(
|
ScanningDialog::run(
|
||||||
QtConcurrent::run(
|
QtConcurrent::run(
|
||||||
[this, current]( QString* homePartitionPath, bool doReuseHomePartition ) {
|
[this, current, homePartitionPath]( bool doReuseHomePartition ) {
|
||||||
QMutexLocker locker( &m_coreMutex );
|
QMutexLocker locker( &m_coreMutex );
|
||||||
|
|
||||||
if ( m_core->isDirty() )
|
if ( m_core->isDirty() )
|
||||||
@ -823,9 +821,8 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
homePartitionPath,
|
m_reuseHomeCheckBox->isChecked() ),
|
||||||
doReuseHomePartition ),
|
[this, homePartitionPath] {
|
||||||
[=] {
|
|
||||||
m_reuseHomeCheckBox->setVisible( !homePartitionPath->isEmpty() );
|
m_reuseHomeCheckBox->setVisible( !homePartitionPath->isEmpty() );
|
||||||
if ( !homePartitionPath->isEmpty() )
|
if ( !homePartitionPath->isEmpty() )
|
||||||
m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." )
|
m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." )
|
||||||
|
Loading…
Reference in New Issue
Block a user