[partition] Add missing ; (and apply coding style)

main
Adriaan de Groot 5 years ago
parent 9341a84820
commit bb426ebac4

@ -53,7 +53,7 @@ BootInfoWidget::BootInfoWidget( QWidget* parent )
m_bootIcon->setPalette( palette ); m_bootIcon->setPalette( palette );
m_bootLabel->setPalette( palette ); m_bootLabel->setPalette( palette );
CALAMARES_RETRANSLATE( retranslateUi(); ) CALAMARES_RETRANSLATE( retranslateUi(); );
} }
void void

@ -119,7 +119,7 @@ ChoicePage::ChoicePage( Config* config, QWidget* parent )
// Drive selector + preview // Drive selector + preview
CALAMARES_RETRANSLATE( retranslateUi( this ); m_drivesLabel->setText( tr( "Select storage de&vice:" ) ); CALAMARES_RETRANSLATE( retranslateUi( this ); m_drivesLabel->setText( tr( "Select storage de&vice:" ) );
m_previewBeforeLabel->setText( tr( "Current:" ) ); m_previewBeforeLabel->setText( tr( "Current:" ) );
m_previewAfterLabel->setText( tr( "After:" ) ); ) m_previewAfterLabel->setText( tr( "After:" ) ); );
m_previewBeforeFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); m_previewBeforeFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
m_previewAfterFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); m_previewAfterFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
@ -298,7 +298,7 @@ ChoicePage::setupChoices()
CALAMARES_RETRANSLATE( m_somethingElseButton->setText( tr( "<strong>Manual partitioning</strong><br/>" CALAMARES_RETRANSLATE( m_somethingElseButton->setText( tr( "<strong>Manual partitioning</strong><br/>"
"You can create or resize partitions yourself." ) ); "You can create or resize partitions yourself." ) );
updateSwapChoicesTr( m_eraseSwapChoiceComboBox ); ) updateSwapChoicesTr( m_eraseSwapChoiceComboBox ); );
} }
@ -360,13 +360,12 @@ ChoicePage::applyDeviceChoice()
if ( m_core->isDirty() ) if ( m_core->isDirty() )
{ {
ScanningDialog::run( ScanningDialog::run( QtConcurrent::run( [=] {
QtConcurrent::run( [=] { QMutexLocker locker( &m_coreMutex );
QMutexLocker locker( &m_coreMutex ); m_core->revertAllDevices();
m_core->revertAllDevices(); } ),
} ), [this] { continueApplyDeviceChoice(); },
[this] { continueApplyDeviceChoice(); }, this );
this );
} }
else else
{ {
@ -453,16 +452,15 @@ ChoicePage::applyActionChoice( InstallChoice choice )
if ( m_core->isDirty() ) if ( m_core->isDirty() )
{ {
ScanningDialog::run( ScanningDialog::run( QtConcurrent::run( [=] {
QtConcurrent::run( [=] { QMutexLocker locker( &m_coreMutex );
QMutexLocker locker( &m_coreMutex ); m_core->revertDevice( selectedDevice() );
m_core->revertDevice( selectedDevice() ); } ),
} ), [=] {
[=] { PartitionActions::doAutopartition( m_core, selectedDevice(), options );
PartitionActions::doAutopartition( m_core, selectedDevice(), options ); emit deviceChosen();
emit deviceChosen(); },
}, this );
this );
} }
else else
{ {
@ -474,13 +472,12 @@ ChoicePage::applyActionChoice( InstallChoice choice )
case InstallChoice::Replace: case InstallChoice::Replace:
if ( m_core->isDirty() ) if ( m_core->isDirty() )
{ {
ScanningDialog::run( ScanningDialog::run( QtConcurrent::run( [=] {
QtConcurrent::run( [=] { QMutexLocker locker( &m_coreMutex );
QMutexLocker locker( &m_coreMutex ); m_core->revertDevice( selectedDevice() );
m_core->revertDevice( selectedDevice() ); } ),
} ), [] {},
[] {}, this );
this );
} }
updateNextEnabled(); updateNextEnabled();
@ -494,18 +491,17 @@ ChoicePage::applyActionChoice( InstallChoice choice )
case InstallChoice::Alongside: case InstallChoice::Alongside:
if ( m_core->isDirty() ) if ( m_core->isDirty() )
{ {
ScanningDialog::run( ScanningDialog::run( QtConcurrent::run( [=] {
QtConcurrent::run( [=] { QMutexLocker locker( &m_coreMutex );
QMutexLocker locker( &m_coreMutex ); m_core->revertDevice( selectedDevice() );
m_core->revertDevice( selectedDevice() ); } ),
} ), [this] {
[this] { // We need to reupdate after reverting because the splitter widget is
// We need to reupdate after reverting because the splitter widget is // not a true view.
// not a true view. updateActionChoicePreview( m_config->installChoice() );
updateActionChoicePreview( m_config->installChoice() ); updateNextEnabled();
updateNextEnabled(); },
}, this );
this );
} }
updateNextEnabled(); updateNextEnabled();
@ -1037,23 +1033,22 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
Calamares::restoreSelectedBootLoader( *m_bootloaderComboBox, m_core->bootLoaderInstallPath() ); Calamares::restoreSelectedBootLoader( *m_bootloaderComboBox, m_core->bootLoaderInstallPath() );
} }
} ); } );
connect( connect( m_core,
m_core, &PartitionCoreModule::deviceReverted,
&PartitionCoreModule::deviceReverted, this,
this, [this]( Device* dev ) {
[this]( Device* dev ) { Q_UNUSED( dev )
Q_UNUSED( dev ) if ( !m_bootloaderComboBox.isNull() )
if ( !m_bootloaderComboBox.isNull() ) {
{ if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() )
if ( m_bootloaderComboBox->model() != m_core->bootLoaderModel() ) {
{ m_bootloaderComboBox->setModel( m_core->bootLoaderModel() );
m_bootloaderComboBox->setModel( m_core->bootLoaderModel() ); }
}
m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex );
m_bootloaderComboBox->setCurrentIndex( m_lastSelectedDeviceIndex ); }
} },
}, Qt::QueuedConnection );
Qt::QueuedConnection );
// ^ Must be Queued so it's sure to run when the widget is already visible. // ^ Must be Queued so it's sure to run when the widget is already visible.
eraseLayout->addWidget( m_bootloaderComboBox ); eraseLayout->addWidget( m_bootloaderComboBox );
@ -1303,7 +1298,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) .arg( Calamares::Branding::instance()->shortVersionedName() ) ); );
m_replaceButton->hide(); m_replaceButton->hide();
m_alongsideButton->hide(); m_alongsideButton->hide();
@ -1337,7 +1332,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) .arg( Calamares::Branding::instance()->shortVersionedName() ) ); );
} }
else else
{ {
@ -1358,7 +1353,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) .arg( Calamares::Branding::instance()->shortVersionedName() ) ); );
} }
} }
else else
@ -1383,7 +1378,7 @@ ChoicePage::setupActions()
m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>" m_replaceButton->setText( tr( "<strong>Replace a partition</strong><br/>"
"Replaces a partition with %1." ) "Replaces a partition with %1." )
.arg( Calamares::Branding::instance()->shortVersionedName() ) ); ) .arg( Calamares::Branding::instance()->shortVersionedName() ) ); );
} }
#ifdef DEBUG_PARTITION_UNSAFE #ifdef DEBUG_PARTITION_UNSAFE

Loading…
Cancel
Save