[partition] Delay requirements checking until pmcore is initialized
This commit is contained in:
parent
ba21a221df
commit
4566e53d01
@ -539,17 +539,18 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
// Now that we have the config, we load the PartitionCoreModule in the background
|
// Now that we have the config, we load the PartitionCoreModule in the background
|
||||||
// because it could take a while. Then when it's done, we can set up the widgets
|
// because it could take a while. Then when it's done, we can set up the widgets
|
||||||
// and remove the spinner.
|
// and remove the spinner.
|
||||||
QFutureWatcher< void >* watcher = new QFutureWatcher< void >();
|
m_future = new QFutureWatcher< void >();
|
||||||
connect( watcher, &QFutureWatcher< void >::finished,
|
connect( m_future, &QFutureWatcher< void >::finished,
|
||||||
this, [ this, watcher ]
|
this, [ this ]
|
||||||
{
|
{
|
||||||
continueLoading();
|
continueLoading();
|
||||||
watcher->deleteLater();
|
this->m_future->deleteLater();
|
||||||
|
this->m_future = nullptr;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QFuture< void > future =
|
QFuture< void > future =
|
||||||
QtConcurrent::run( this, &PartitionViewStep::initPartitionCoreModule );
|
QtConcurrent::run( this, &PartitionViewStep::initPartitionCoreModule );
|
||||||
watcher->setFuture( future );
|
m_future->setFuture( future );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -561,13 +562,16 @@ PartitionViewStep::jobs() const
|
|||||||
|
|
||||||
Calamares::RequirementsList PartitionViewStep::checkRequirements()
|
Calamares::RequirementsList PartitionViewStep::checkRequirements()
|
||||||
{
|
{
|
||||||
|
if (m_future)
|
||||||
|
m_future->waitForFinished();
|
||||||
|
|
||||||
Calamares::RequirementsList l;
|
Calamares::RequirementsList l;
|
||||||
l.append(
|
l.append(
|
||||||
{
|
{
|
||||||
QLatin1Literal( "partitions" ),
|
QLatin1Literal( "partitions" ),
|
||||||
[]{ return QString(); },
|
[]{ return QString(); },
|
||||||
[this]{ return tr( "There are no partitons to install on." ); },
|
[this]{ return tr( "There are no partitons to install on." ); },
|
||||||
false, // satisfied
|
m_core->deviceModel()->rowCount() > 0, // satisfied
|
||||||
true // required
|
true // required
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ class PartitionPage;
|
|||||||
class PartitionCoreModule;
|
class PartitionCoreModule;
|
||||||
class QStackedWidget;
|
class QStackedWidget;
|
||||||
|
|
||||||
|
template<typename T> class QFutureWatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The starting point of the module. Instantiates PartitionCoreModule,
|
* The starting point of the module. Instantiates PartitionCoreModule,
|
||||||
* ChoicePage and PartitionPage, then connects them.
|
* ChoicePage and PartitionPage, then connects them.
|
||||||
@ -78,6 +80,7 @@ private:
|
|||||||
PartitionPage* m_manualPartitionPage;
|
PartitionPage* m_manualPartitionPage;
|
||||||
|
|
||||||
QWidget* m_waitingWidget;
|
QWidget* m_waitingWidget;
|
||||||
|
QFutureWatcher<void>* m_future;
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
||||||
|
Loading…
Reference in New Issue
Block a user