|
|
|
@ -551,26 +551,22 @@ PartitionCoreModule::lvmPVs() const
|
|
|
|
|
bool
|
|
|
|
|
PartitionCoreModule::hasVGwithThisName( const QString& name ) const
|
|
|
|
|
{
|
|
|
|
|
for ( DeviceInfo* d : m_deviceInfos )
|
|
|
|
|
if ( dynamic_cast<LvmDevice*>(d->device.data()) &&
|
|
|
|
|
d->device.data()->name() == name)
|
|
|
|
|
return true;
|
|
|
|
|
auto condition = [ name ]( DeviceInfo* d ) {
|
|
|
|
|
return dynamic_cast<LvmDevice*>(d->device.data()) && d->device.data()->name() == name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return std::find_if( m_deviceInfos.begin(), m_deviceInfos.end(), condition ) != m_deviceInfos.end();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
PartitionCoreModule::isInVG( const Partition *partition ) const
|
|
|
|
|
{
|
|
|
|
|
for ( DeviceInfo* d : m_deviceInfos )
|
|
|
|
|
{
|
|
|
|
|
LvmDevice* vg = dynamic_cast<LvmDevice*>( d->device.data() );
|
|
|
|
|
auto condition = [ partition ]( DeviceInfo* d ) {
|
|
|
|
|
LvmDevice* vg = dynamic_cast<LvmDevice*>( d->device.data());
|
|
|
|
|
return vg && vg->physicalVolumes().contains( partition );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ( vg && vg->physicalVolumes().contains( partition ))
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return std::find_if( m_deviceInfos.begin(), m_deviceInfos.end(), condition ) != m_deviceInfos.end();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|