Skip to content
Snippets Groups Projects
Commit 0d0e3bf7 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Add hack to PCM to create a rescanned device copy to use as preview.

parent 6b40c8aa
No related branches found
No related tags found
No related merge requests found
...@@ -151,6 +151,17 @@ PartitionCoreModule::partitionModelForDevice( Device* device ) const ...@@ -151,6 +151,17 @@ PartitionCoreModule::partitionModelForDevice( Device* device ) const
return info->partitionModel.data(); return info->partitionModel.data();
} }
Device*
PartitionCoreModule::createImmutableDeviceCopy( Device* device ) const
{
CoreBackend* backend = CoreBackendManager::self()->backend();
Device* deviceBefore = backend->scanDevice( device->deviceNode() );
return deviceBefore;
}
void void
PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type ) PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type )
{ {
......
...@@ -65,6 +65,14 @@ public: ...@@ -65,6 +65,14 @@ public:
PartitionModel* partitionModelForDevice( Device* device ) const; 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; QAbstractItemModel* bootLoaderModel() const;
void createPartitionTable( Device* device, PartitionTable::TableType type ); void createPartitionTable( Device* device, PartitionTable::TableType type );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment