Clean up a bit.

This commit is contained in:
Teo Mrnjavac 2015-12-24 17:24:26 +01:00
parent 6db6dc0e08
commit f31a45e53a
2 changed files with 25 additions and 22 deletions

View File

@ -442,10 +442,23 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
watcher->deleteLater(); watcher->deleteLater();
} ); } );
auto doReplace = [ this, current ] QFuture< void > future = QtConcurrent::run( this, &ChoicePage::doReplaceSelectedPartition, current );
watcher->setFuture( future );
} );
break;
case NoChoice:
case Manual:
break;
}
updateActionChoicePreview( currentChoice() );
}
void
ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
{ {
cDebug() << "begin doReplace"; cDebug() << "begin doReplace";
QMutexLocker( &( ChoicePage::m_coreMutex ) ); QMutexLocker locker( &m_coreMutex );
if ( m_core->isDirty() ) if ( m_core->isDirty() )
{ {
@ -461,17 +474,6 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
selectedDevice(), selectedDevice(),
partition ); partition );
cDebug() << "end doReplace"; cDebug() << "end doReplace";
};
QFuture< void > future = QtConcurrent::run( doReplace );
watcher->setFuture( future );
} );
break;
case NoChoice:
case Manual:
break;
}
updateActionChoicePreview( currentChoice() );
} }

View File

@ -76,6 +76,7 @@ private:
ExpandableRadioButton* createEraseButton(); ExpandableRadioButton* createEraseButton();
Device* selectedDevice(); Device* selectedDevice();
void applyDeviceChoice(); void applyDeviceChoice();
void doReplaceSelectedPartition( const QModelIndex& current );
void updateDeviceStatePreview(); void updateDeviceStatePreview();
void applyActionChoice( ChoicePage::Choice choice ); void applyActionChoice( ChoicePage::Choice choice );
void updateActionChoicePreview( ChoicePage::Choice choice ); void updateActionChoicePreview( ChoicePage::Choice choice );