diff --git a/src/modules/partition/PartitionCoreModule.cpp b/src/modules/partition/PartitionCoreModule.cpp index a67218f0c..d3e647125 100644 --- a/src/modules/partition/PartitionCoreModule.cpp +++ b/src/modules/partition/PartitionCoreModule.cpp @@ -88,13 +88,28 @@ PartitionCoreModule::createPartition( Device* device, PartitionInfo* partitionIn partitionModel->reload(); m_jobs << Calamares::job_ptr( job ); + if ( partitionInfo->mountPoint == "/" && !m_hasRootMountPoint ) + { + m_hasRootMountPoint = true; + hasRootMountPointChanged( m_hasRootMountPoint ); + } + dumpQueue(); } void PartitionCoreModule::deletePartition( Device* device, Partition* partition ) { - m_infoForPartitionHash.remove( partition ); + auto it = m_infoForPartitionHash.find( partition ); + if ( it != m_infoForPartitionHash.end() ) + { + if ( it.value()->mountPoint == "/" ) + { + m_hasRootMountPoint = false; + hasRootMountPointChanged( m_hasRootMountPoint ); + } + m_infoForPartitionHash.erase( it ); + } if ( partition->state() == Partition::StateNew ) { diff --git a/src/modules/partition/PartitionCoreModule.h b/src/modules/partition/PartitionCoreModule.h index 7640ea8d9..8cb9fa6b8 100644 --- a/src/modules/partition/PartitionCoreModule.h +++ b/src/modules/partition/PartitionCoreModule.h @@ -41,6 +41,7 @@ class PartitionModel; */ class PartitionCoreModule : public QObject { + Q_OBJECT public: PartitionCoreModule( QObject* parent = nullptr ); ~PartitionCoreModule(); @@ -58,10 +59,19 @@ public: return m_jobs; } + bool hasRootMountPoint() const + { + return m_hasRootMountPoint; + } + +Q_SIGNALS: + void hasRootMountPointChanged( bool value ); + private: QList< Device* > m_devices; QHash< Device*, PartitionModel* > m_partitionModelForDeviceHash; DeviceModel* m_deviceModel; + bool m_hasRootMountPoint = false; InfoForPartitionHash m_infoForPartitionHash; diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index 1a170489c..744bc99f1 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -27,6 +27,8 @@ PartitionViewStep::PartitionViewStep( QObject* parent ) , m_core( new PartitionCoreModule( this ) ) , m_widget( new PartitionPage( m_core ) ) { + connect( m_core, SIGNAL( hasRootMountPointChanged( bool ) ), + SIGNAL( nextStatusChanged( bool ) ) ); } @@ -60,7 +62,7 @@ PartitionViewStep::back() bool PartitionViewStep::isNextEnabled() const { - return false; + return m_core->hasRootMountPoint(); }