mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
[luksbootkeyfile] Refactor static function to outside class
This commit is contained in:
parent
7d7d4c69ef
commit
efd409cf78
1 changed files with 25 additions and 25 deletions
|
@ -66,27 +66,15 @@ struct LuksDevice
|
||||||
QString passphrase;
|
QString passphrase;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LuksDeviceList
|
/** @brief Extract the luks passphrases setup.
|
||||||
{
|
|
||||||
LuksDeviceList( const QVariant& partitions )
|
|
||||||
: valid( false )
|
|
||||||
{
|
|
||||||
if ( partitions.canConvert< QVariantList >() )
|
|
||||||
{
|
|
||||||
devices = getLuksDevices( partitions.toList() );
|
|
||||||
valid = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Extract the luks passphrases setup.
|
|
||||||
*
|
*
|
||||||
* Given a list of partitions (as set up by the partitioning module,
|
* Given a list of partitions (as set up by the partitioning module,
|
||||||
* so there's maps with keys inside), returns just the list of
|
* so there's maps with keys inside), returns just the list of
|
||||||
* luks passphrases for each device.
|
* luks passphrases for each device.
|
||||||
*/
|
*/
|
||||||
static QList< LuksDevice >
|
static QList< LuksDevice >
|
||||||
getLuksDevices( const QVariantList& list )
|
getLuksDevices( const QVariantList& list )
|
||||||
{
|
{
|
||||||
QList< LuksDevice > luksItems;
|
QList< LuksDevice > luksItems;
|
||||||
|
|
||||||
for ( const auto& p : list )
|
for ( const auto& p : list )
|
||||||
|
@ -101,6 +89,18 @@ struct LuksDeviceList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return luksItems;
|
return luksItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct LuksDeviceList
|
||||||
|
{
|
||||||
|
LuksDeviceList( const QVariant& partitions )
|
||||||
|
: valid( false )
|
||||||
|
{
|
||||||
|
if ( partitions.canConvert< QVariantList >() )
|
||||||
|
{
|
||||||
|
devices = getLuksDevices( partitions.toList() );
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList< LuksDevice > devices;
|
QList< LuksDevice > devices;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue