diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 23736d527..8a375f625 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -151,6 +151,17 @@ PartitionCoreModule::partitionModelForDevice( Device* device ) const return info->partitionModel.data(); } + +Device* +PartitionCoreModule::createImmutableDeviceCopy( Device* device ) const +{ + CoreBackend* backend = CoreBackendManager::self()->backend(); + + Device* deviceBefore = backend->scanDevice( device->deviceNode() ); + return deviceBefore; +} + + void PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type ) { diff --git a/src/modules/partition/core/PartitionCoreModule.h b/src/modules/partition/core/PartitionCoreModule.h index 678984813..8c399afa7 100644 --- a/src/modules/partition/core/PartitionCoreModule.h +++ b/src/modules/partition/core/PartitionCoreModule.h @@ -65,6 +65,14 @@ public: PartitionModel* partitionModelForDevice( Device* device ) const; + //HACK: all devices change over time, and together make up the state of the CoreModule. + // However this makes it hard to show the *original* state of a device. + // With this horrible hack we rescan a single device node to create a Device object + // that contains the current state of a disk regardless of subsequent changes. + // This should probably be redone some other way. + // -- Teo 4/2015 + Device* createImmutableDeviceCopy( Device* device ) const; + QAbstractItemModel* bootLoaderModel() const; void createPartitionTable( Device* device, PartitionTable::TableType type );