mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-25 19:35:44 -05:00
Revert "Test out a way to make the rescan asynchronous."
This reverts commit e3f28189ced7aa22b3b7a6dc1506a17cbc1325b5.
This commit is contained in:
parent
d742431ee9
commit
019faf730c
1 changed files with 11 additions and 27 deletions
|
@ -46,8 +46,6 @@
|
|||
#include <QDir>
|
||||
#include <QLabel>
|
||||
#include <QListView>
|
||||
#include <QFutureWatcher>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
|
||||
|
||||
|
@ -439,35 +437,21 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
|
|||
connect( m_beforePartitionBarsView->selectionModel(), &QItemSelectionModel::currentRowChanged,
|
||||
this, [ this ]( const QModelIndex& current, const QModelIndex& previous )
|
||||
{
|
||||
auto doReplace = [=]
|
||||
{
|
||||
// We can't use the PartitionPtrRole because we need to make changes to the
|
||||
// main DeviceModel, not the immutable copy.
|
||||
QString partPath = current.data( PartitionModel::PartitionPathRole ).toString();
|
||||
Partition* partition = KPMHelpers::findPartitionByPath( { selectedDevice() },
|
||||
partPath );
|
||||
if ( partition )
|
||||
PartitionActions::doReplacePartition( m_core,
|
||||
selectedDevice(),
|
||||
partition );
|
||||
};
|
||||
|
||||
if ( m_core->isDirty() )
|
||||
{
|
||||
QFutureWatcher< void > watcher;
|
||||
connect( &watcher, &QFutureWatcher< void >::finished,
|
||||
this, doReplace );
|
||||
|
||||
QFuture< void > future = QtConcurrent::run( [=]
|
||||
{
|
||||
m_core->revertDevice( selectedDevice() );
|
||||
m_core->clearJobs();
|
||||
} );
|
||||
watcher.setFuture( future );
|
||||
m_core->revertDevice( selectedDevice() );
|
||||
m_core->clearJobs();
|
||||
}
|
||||
else
|
||||
doReplace();
|
||||
|
||||
// We can't use the PartitionPtrRole because we need to make changes to the
|
||||
// main DeviceModel, not the immutable copy.
|
||||
QString partPath = current.data( PartitionModel::PartitionPathRole ).toString();
|
||||
Partition* partition = KPMHelpers::findPartitionByPath( { selectedDevice() },
|
||||
partPath );
|
||||
if ( partition )
|
||||
PartitionActions::doReplacePartition( m_core,
|
||||
selectedDevice(),
|
||||
partition );
|
||||
} );
|
||||
break;
|
||||
case NoChoice:
|
||||
|
|
Loading…
Add table
Reference in a new issue