Factorize management of m_hasRootMountPoint
This commit is contained in:
parent
8d3f197fde
commit
5d6a80deae
@ -87,11 +87,7 @@ PartitionCoreModule::createPartition( Device* device, PartitionInfo* partitionIn
|
|||||||
|
|
||||||
m_jobs << Calamares::job_ptr( job );
|
m_jobs << Calamares::job_ptr( job );
|
||||||
|
|
||||||
if ( partitionInfo->mountPoint == "/" && !m_hasRootMountPoint )
|
updateHasRootMountPoint();
|
||||||
{
|
|
||||||
m_hasRootMountPoint = true;
|
|
||||||
hasRootMountPointChanged( m_hasRootMountPoint );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -100,11 +96,6 @@ PartitionCoreModule::deletePartition( Device* device, Partition* partition )
|
|||||||
auto it = m_infoForPartitionHash.find( partition );
|
auto it = m_infoForPartitionHash.find( partition );
|
||||||
if ( it != m_infoForPartitionHash.end() )
|
if ( it != m_infoForPartitionHash.end() )
|
||||||
{
|
{
|
||||||
if ( it.value()->mountPoint == "/" )
|
|
||||||
{
|
|
||||||
m_hasRootMountPoint = false;
|
|
||||||
hasRootMountPointChanged( m_hasRootMountPoint );
|
|
||||||
}
|
|
||||||
m_infoForPartitionHash.erase( it );
|
m_infoForPartitionHash.erase( it );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,6 +132,7 @@ PartitionCoreModule::deletePartition( Device* device, Partition* partition )
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshPartitionModel( device );
|
refreshPartitionModel( device );
|
||||||
|
updateHasRootMountPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -160,3 +152,22 @@ PartitionCoreModule::refreshPartitionModel( Device* device )
|
|||||||
Q_ASSERT( model );
|
Q_ASSERT( model );
|
||||||
model->reload();
|
model->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PartitionCoreModule::updateHasRootMountPoint()
|
||||||
|
{
|
||||||
|
bool oldValue = m_hasRootMountPoint;
|
||||||
|
|
||||||
|
m_hasRootMountPoint = false;
|
||||||
|
for ( auto it : m_infoForPartitionHash )
|
||||||
|
{
|
||||||
|
if ( it->mountPoint == "/" )
|
||||||
|
{
|
||||||
|
m_hasRootMountPoint = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( oldValue != m_hasRootMountPoint )
|
||||||
|
{
|
||||||
|
hasRootMountPointChanged( m_hasRootMountPoint );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -78,7 +78,7 @@ private:
|
|||||||
QList< Calamares::job_ptr > m_jobs;
|
QList< Calamares::job_ptr > m_jobs;
|
||||||
|
|
||||||
void listDevices();
|
void listDevices();
|
||||||
|
void updateHasRootMountPoint();
|
||||||
void refreshPartitionModel( Device* device );
|
void refreshPartitionModel( Device* device );
|
||||||
|
|
||||||
void dumpQueue() const;
|
void dumpQueue() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user