From 1b64917385bfde042488905d939bd6d57fb8a947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 22 Jul 2014 10:50:08 +0200 Subject: [PATCH] Use findPartitionByMountPoint in updateHasRootMountPoint --- src/modules/partition/PartitionCoreModule.cpp | 22 +------------------ src/modules/partition/PartitionCoreModule.h | 2 -- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/modules/partition/PartitionCoreModule.cpp b/src/modules/partition/PartitionCoreModule.cpp index b4a1bc432..09eec3a18 100644 --- a/src/modules/partition/PartitionCoreModule.cpp +++ b/src/modules/partition/PartitionCoreModule.cpp @@ -129,17 +129,6 @@ PartitionCoreModule::DeviceInfo::~DeviceInfo() { } -bool -PartitionCoreModule::DeviceInfo::hasRootMountPoint() const -{ - for ( auto it = PartitionIterator::begin( device.data() ); it != PartitionIterator::end( device.data() ); ++it ) - { - if ( PartitionInfo::mountPoint( *it ) == "/" ) - return true; - } - return false; -} - void PartitionCoreModule::DeviceInfo::forgetChanges() { @@ -338,16 +327,7 @@ PartitionCoreModule::refresh( Device* device ) void PartitionCoreModule::updateHasRootMountPoint() { bool oldValue = m_hasRootMountPoint; - - m_hasRootMountPoint = false; - for ( auto deviceInfo : m_deviceInfos ) - { - if ( deviceInfo->hasRootMountPoint() ) - { - m_hasRootMountPoint = true; - break; - } - } + m_hasRootMountPoint = findPartitionByMountPoint( "/" ); if ( oldValue != m_hasRootMountPoint ) hasRootMountPointChanged( m_hasRootMountPoint ); diff --git a/src/modules/partition/PartitionCoreModule.h b/src/modules/partition/PartitionCoreModule.h index a1db8c57f..8e1a891a1 100644 --- a/src/modules/partition/PartitionCoreModule.h +++ b/src/modules/partition/PartitionCoreModule.h @@ -90,8 +90,6 @@ private: QScopedPointer< PartitionModel > partitionModel; QList< Calamares::job_ptr > jobs; - bool hasRootMountPoint() const; - void forgetChanges(); }; QList< DeviceInfo* > m_deviceInfos;