From c2929e93b3f409514c6c31189f9b348a9bce4ba7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 3 Aug 2020 13:13:56 +0200 Subject: [PATCH] [partition] Start sanitizing the Jobs on a Device - having a struct with an obtuse API for adding jobs-that-need-to-happen- to-this-device is just not good for maintainability. - break the build by making things private. --- src/modules/partition/core/PartitionCoreModule.cpp | 6 ++++-- src/modules/partition/core/PartitionCoreModule.h | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 8856778b3..f29db1812 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -120,7 +120,7 @@ PartitionCoreModule::DeviceInfo::~DeviceInfo() {} void PartitionCoreModule::DeviceInfo::forgetChanges() { - jobs.clear(); + m_jobs.clear(); for ( auto it = PartitionIterator::begin( device.data() ); it != PartitionIterator::end( device.data() ); ++it ) { PartitionInfo::reset( *it ); @@ -132,16 +132,18 @@ PartitionCoreModule::DeviceInfo::forgetChanges() bool PartitionCoreModule::DeviceInfo::isDirty() const { - if ( !jobs.isEmpty() ) + if ( !m_jobs.isEmpty() ) { return true; } for ( auto it = PartitionIterator::begin( device.data() ); it != PartitionIterator::end( device.data() ); ++it ) + { if ( PartitionInfo::isDirty( *it ) ) { return true; } + } return false; } diff --git a/src/modules/partition/core/PartitionCoreModule.h b/src/modules/partition/core/PartitionCoreModule.h index f88544ae8..35764424c 100644 --- a/src/modules/partition/core/PartitionCoreModule.h +++ b/src/modules/partition/core/PartitionCoreModule.h @@ -255,13 +255,17 @@ private: QScopedPointer< Device > device; QScopedPointer< PartitionModel > partitionModel; const QScopedPointer< Device > immutableDevice; - Calamares::JobList jobs; // To check if LVM VGs are deactivated bool isAvailable; void forgetChanges(); bool isDirty() const; + + const Calamares::JobList& jobs() const { return m_jobs; } + + private: + Calamares::JobList m_jobs; }; QList< DeviceInfo* > m_deviceInfos; QList< Partition* > m_efiSystemPartitions;