mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
PartitionCoreModule::revertDevice.
This commit is contained in:
parent
fe5ab75e82
commit
0a0a0d58e0
2 changed files with 25 additions and 0 deletions
|
@ -500,6 +500,30 @@ PartitionCoreModule::revert()
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
PartitionCoreModule::revertDevice( Device* dev )
|
||||
{
|
||||
DeviceInfo* devInfo = infoForDevice( dev );
|
||||
if ( !devInfo )
|
||||
return;
|
||||
devInfo->forgetChanges();
|
||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
||||
Device *newDev = backend->scanDevice( devInfo->device->deviceNode() );
|
||||
devInfo->device.reset( newDev );
|
||||
m_deviceModel->swapDevice( dev, newDev );
|
||||
|
||||
QList< Device* > devices;
|
||||
foreach ( auto info, m_deviceInfos )
|
||||
devices.append( info->device.data() );
|
||||
|
||||
m_bootLoaderModel->init( devices );
|
||||
|
||||
devInfo->partitionModel->init( newDev, m_osproberLines );
|
||||
|
||||
updateIsDirty();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PartitionCoreModule::clearJobs()
|
||||
{
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
QList< Partition* > efiSystemPartitions() const;
|
||||
|
||||
void revert();
|
||||
void revertDevice( Device* dev );
|
||||
|
||||
void clearJobs();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue