mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -04:00
Forget pending changes when the partition table is recreated
This commit is contained in:
parent
f0dffb7400
commit
7ac6588090
2 changed files with 17 additions and 4 deletions
|
@ -82,6 +82,14 @@ PartitionCoreModule::DeviceInfo::hasRootMountPoint() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PartitionCoreModule::DeviceInfo::forgetChanges()
|
||||||
|
{
|
||||||
|
jobs.clear();
|
||||||
|
qDeleteAll( m_partitionInfoHash );
|
||||||
|
m_partitionInfoHash.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//- PartitionCoreModule ------------------------------------
|
//- PartitionCoreModule ------------------------------------
|
||||||
PartitionCoreModule::PartitionCoreModule( QObject* parent )
|
PartitionCoreModule::PartitionCoreModule( QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
|
@ -128,13 +136,16 @@ PartitionCoreModule::partitionModelForDevice( Device* device ) const
|
||||||
void
|
void
|
||||||
PartitionCoreModule::createPartitionTable( Device* device )
|
PartitionCoreModule::createPartitionTable( Device* device )
|
||||||
{
|
{
|
||||||
|
DeviceInfo* info = infoForDevice( device );
|
||||||
|
// Creating a partition table wipes all the disk, so there is no need to
|
||||||
|
// keep previous changes
|
||||||
|
info->forgetChanges();
|
||||||
|
|
||||||
CreatePartitionTableJob* job = new CreatePartitionTableJob( device );
|
CreatePartitionTableJob* job = new CreatePartitionTableJob( device );
|
||||||
job->updatePreview();
|
job->updatePreview();
|
||||||
refreshPartitionModel( device );
|
info->jobs << Calamares::job_ptr( job );
|
||||||
|
|
||||||
// FIXME: Remove all jobs queued for this device, as well as all partition
|
refreshPartitionModel( device );
|
||||||
// info
|
|
||||||
infoForDevice( device )->jobs << Calamares::job_ptr( job );
|
|
||||||
updateHasRootMountPoint();
|
updateHasRootMountPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,8 @@ private:
|
||||||
void removeInfoForPartition( Partition* partition );
|
void removeInfoForPartition( Partition* partition );
|
||||||
|
|
||||||
bool hasRootMountPoint() const;
|
bool hasRootMountPoint() const;
|
||||||
|
|
||||||
|
void forgetChanges();
|
||||||
private:
|
private:
|
||||||
QHash< Partition*, PartitionInfo* > m_partitionInfoHash;
|
QHash< Partition*, PartitionInfo* > m_partitionInfoHash;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue