Rearrange asynchronous scan in PartitionCoreModule a bit.
This commit is contained in:
parent
92eb947cc5
commit
45f6e6c55b
@ -105,11 +105,19 @@ PartitionCoreModule::PartitionCoreModule( QObject* parent )
|
||||
if ( !KPMHelpers::initKPMcore() )
|
||||
qFatal( "Failed to initialize KPMcore backend" );
|
||||
FileSystemFactory::init();
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PartitionCoreModule::init()
|
||||
{
|
||||
QMutexLocker locker( &m_revertMutex );
|
||||
doInit();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PartitionCoreModule::doInit()
|
||||
{
|
||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
||||
QList< Device* > devices = backend->scanDevices( true );
|
||||
@ -546,7 +554,7 @@ PartitionCoreModule::revert()
|
||||
QMutexLocker locker( &m_revertMutex );
|
||||
qDeleteAll( m_deviceInfos );
|
||||
m_deviceInfos.clear();
|
||||
init();
|
||||
doInit();
|
||||
updateIsDirty();
|
||||
emit reverted();
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ public:
|
||||
PartitionCoreModule( QObject* parent = nullptr );
|
||||
~PartitionCoreModule();
|
||||
|
||||
void init();
|
||||
|
||||
DeviceModel* deviceModel() const;
|
||||
|
||||
PartitionModel* partitionModelForDevice( Device* device ) const;
|
||||
@ -159,7 +161,7 @@ private:
|
||||
bool m_isDirty = false;
|
||||
QString m_bootLoaderInstallPath;
|
||||
|
||||
void init();
|
||||
void doInit();
|
||||
void updateHasRootMountPoint();
|
||||
void updateIsDirty();
|
||||
void scanForEfiSystemPartitions();
|
||||
|
@ -58,8 +58,8 @@
|
||||
|
||||
PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_widget( new QStackedWidget() )
|
||||
, m_core( nullptr )
|
||||
, m_widget( new QStackedWidget() )
|
||||
, m_choicePage( nullptr )
|
||||
, m_manualPartitionPage( nullptr )
|
||||
{
|
||||
@ -69,6 +69,7 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||
m_widget->addWidget( m_waitingWidget );
|
||||
CALAMARES_RETRANSLATE( qobject_cast< WaitingWidget* >( m_waitingWidget )->setText( tr( "Gathering system information..." ) ); )
|
||||
|
||||
m_core = new PartitionCoreModule( this ); // Unusable before init is complete!
|
||||
// We're not done loading, but we need the configuration map first.
|
||||
}
|
||||
|
||||
@ -76,8 +77,8 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||
void
|
||||
PartitionViewStep::initPartitionCoreModule()
|
||||
{
|
||||
Q_ASSERT( !m_core );
|
||||
m_core = new PartitionCoreModule( this );
|
||||
Q_ASSERT( m_core );
|
||||
m_core->init();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user