[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,24 +60,24 @@ 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
QRegularExpression re( QStringLiteral( "Created a new partition (\\d+)" ) );
QRegularExpressionMatch rem = re.match( r.getOutput() );
QString deviceNode;
if ( rem.hasMatch() )
{
if ( partition->devicePath().back().isDigit() )
QRegularExpression re( QStringLiteral( "Created a new partition (\\d+)" ) );
QRegularExpressionMatch rem = re.match( r.getOutput() );
if ( rem.hasMatch() )
{
deviceNode = partition->devicePath() + QLatin1Char( 'p' ) + rem.captured( 1 );
}
else
{
deviceNode = partition->devicePath() + rem.captured( 1 );
if ( partition->devicePath().back().isDigit() )
{
deviceNode = partition->devicePath() + QLatin1Char( 'p' ) + rem.captured( 1 );
}
else
{
deviceNode = partition->devicePath() + rem.captured( 1 );
}
}
partition->setPartitionPath( deviceNode );
}
partition->setPartitionPath( deviceNode );
// If it is a gpt device, set the partition UUID
if ( device->partitionTable()->type() == PartitionTable::gpt && partition->uuid().isEmpty() )
{