[partition] Reduce warnings about shadowed variables

This commit is contained in:
Adriaan de Groot 2021-12-06 14:52:33 +01:00
parent d89553a777
commit 149f3ff3fe

View file

@ -60,10 +60,11 @@ createZfs( Partition* partition, Device* device )
// Now we need to do some things that would normally be done by kpmcore
// First we get the device node from the output and set it as the partition path
QString deviceNode;
{
QRegularExpression re( QStringLiteral( "Created a new partition (\\d+)" ) );
QRegularExpressionMatch rem = re.match( r.getOutput() );
QString deviceNode;
if ( rem.hasMatch() )
{
if ( partition->devicePath().back().isDigit() )
@ -75,9 +76,8 @@ createZfs( Partition* partition, Device* device )
deviceNode = partition->devicePath() + rem.captured( 1 );
}
}
partition->setPartitionPath( deviceNode );
}
// If it is a gpt device, set the partition UUID
if ( device->partitionTable()->type() == PartitionTable::gpt && partition->uuid().isEmpty() )
{