[partition] Apply coding style to core/
This commit is contained in:
parent
eb6270982f
commit
8b41a71668
@ -920,13 +920,16 @@ PartitionCoreModule::layoutApply( Device* dev,
|
|||||||
// TODO: perhaps the partition that holds the bootloader?
|
// TODO: perhaps the partition that holds the bootloader?
|
||||||
const QString boot = QStringLiteral( "/boot" );
|
const QString boot = QStringLiteral( "/boot" );
|
||||||
const QString root = QStringLiteral( "/" );
|
const QString root = QStringLiteral( "/" );
|
||||||
const auto is_boot = [&](Partition*p) -> bool {return PartitionInfo::mountPoint(p) == boot || p->mountPoint() == boot;};
|
const auto is_boot
|
||||||
const auto is_root = [&](Partition*p) -> bool {return PartitionInfo::mountPoint(p) == root || p->mountPoint() == root;};
|
= [&]( Partition* p ) -> bool { return PartitionInfo::mountPoint( p ) == boot || p->mountPoint() == boot; };
|
||||||
|
const auto is_root
|
||||||
|
= [&]( Partition* p ) -> bool { return PartitionInfo::mountPoint( p ) == root || p->mountPoint() == root; };
|
||||||
|
|
||||||
const bool separate_boot_partition = std::find_if(partList.constBegin(), partList.constEnd(), is_boot) != partList.constEnd();
|
const bool separate_boot_partition
|
||||||
for( Partition* part : partList )
|
= std::find_if( partList.constBegin(), partList.constEnd(), is_boot ) != partList.constEnd();
|
||||||
|
for ( Partition* part : partList )
|
||||||
{
|
{
|
||||||
if ( ( separate_boot_partition && is_boot(part)) || (!separate_boot_partition && is_root(part)))
|
if ( ( separate_boot_partition && is_boot( part ) ) || ( !separate_boot_partition && is_root( part ) ) )
|
||||||
{
|
{
|
||||||
createPartition(
|
createPartition(
|
||||||
dev, part, part->activeFlags() | ( isEfi ? KPM_PARTITION_FLAG( None ) : KPM_PARTITION_FLAG( Boot ) ) );
|
dev, part, part->activeFlags() | ( isEfi ? KPM_PARTITION_FLAG( None ) : KPM_PARTITION_FLAG( Boot ) ) );
|
||||||
|
@ -257,7 +257,7 @@ PartitionLayout::execute( Device* dev,
|
|||||||
#if defined( WITH_KPMCORE42API )
|
#if defined( WITH_KPMCORE42API )
|
||||||
for ( const auto& k : part.partFeatures.keys() )
|
for ( const auto& k : part.partFeatures.keys() )
|
||||||
{
|
{
|
||||||
currentPartition->fileSystem().addFeature( k, part.partFeatures.value(k) );
|
currentPartition->fileSystem().addFeature( k, part.partFeatures.value( k ) );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
cWarning() << "Ignoring features; requires KPMcore >= 4.2.0.";
|
cWarning() << "Ignoring features; requires KPMcore >= 4.2.0.";
|
||||||
|
Loading…
Reference in New Issue
Block a user