Keep an immutable copy for every scanned Device* to avoid rescans.

This commit is contained in:
Teo Mrnjavac 2016-09-09 11:25:04 +02:00
parent 464336d609
commit c316d22b08
3 changed files with 20 additions and 15 deletions

View file

@ -68,7 +68,7 @@ public:
DeviceModel* deviceModel() const;
PartitionModel* partitionModelForDevice( Device* device ) const;
PartitionModel* partitionModelForDevice( const 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.
@ -77,7 +77,7 @@ public:
// This should probably be redone some other way.
// -- Teo 4/2015
//FIXME: make this horrible method private. -- Teo 12/2015
static Device* createImmutableDeviceCopy( Device* device );
Device* immutableDeviceCopy( const Device* device );
QAbstractItemModel* bootLoaderModel() const;
@ -147,6 +147,7 @@ private:
~DeviceInfo();
QScopedPointer< Device > device;
QScopedPointer< PartitionModel > partitionModel;
const QScopedPointer< Device > immutableDevice;
QList< Calamares::job_ptr > jobs;
void forgetChanges();
@ -166,7 +167,7 @@ private:
void updateIsDirty();
void scanForEfiSystemPartitions();
DeviceInfo* infoForDevice( Device* ) const;
DeviceInfo* infoForDevice( const Device* ) const;
OsproberEntryList m_osproberLines;