PartitionCoreModule::revertDevice.

This commit is contained in:
Teo Mrnjavac 2015-12-17 18:00:00 +01:00
parent fe5ab75e82
commit 0a0a0d58e0
2 changed files with 25 additions and 0 deletions

View File

@ -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()
{

View File

@ -94,6 +94,7 @@ public:
QList< Partition* > efiSystemPartitions() const;
void revert();
void revertDevice( Device* dev );
void clearJobs();