Use device's immutable copy instead of rescanning.

This commit is contained in:
Chantara Tith 2016-09-11 15:56:06 +07:00 committed by Philip
parent 297cf45bba
commit ed42185927

View File

@ -685,7 +685,6 @@ QList< PartitionCoreModule::SummaryInfo >
PartitionCoreModule::createSummaryInfo() const PartitionCoreModule::createSummaryInfo() const
{ {
QList< SummaryInfo > lst; QList< SummaryInfo > lst;
CoreBackend* backend = CoreBackendManager::self()->backend();
for ( auto deviceInfo : m_deviceInfos ) for ( auto deviceInfo : m_deviceInfos )
{ {
if ( !deviceInfo->isDirty() ) if ( !deviceInfo->isDirty() )
@ -694,7 +693,7 @@ PartitionCoreModule::createSummaryInfo() const
summaryInfo.deviceName = deviceInfo->device->name(); summaryInfo.deviceName = deviceInfo->device->name();
summaryInfo.deviceNode = deviceInfo->device->deviceNode(); summaryInfo.deviceNode = deviceInfo->device->deviceNode();
Device* deviceBefore = backend->scanDevice( deviceInfo->device->deviceNode() ); Device* deviceBefore = deviceInfo->immutableDevice.data();
summaryInfo.partitionModelBefore = new PartitionModel; summaryInfo.partitionModelBefore = new PartitionModel;
summaryInfo.partitionModelBefore->init( deviceBefore, m_osproberLines ); summaryInfo.partitionModelBefore->init( deviceBefore, m_osproberLines );
// Make deviceBefore a child of partitionModelBefore so that it is not // Make deviceBefore a child of partitionModelBefore so that it is not