mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 11:25:36 -04:00
welcome: Fix requirements parsing
As the config files integer are now of type `QVariant::LongLong` instead of `QVariant::Int`, requirements relying on this type were not parsed correctly. This patch fixes this, and adds an option to the python conversion to take into account `QVariant::LongLong` types. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
0d06e047ae
commit
3929557a5a
2 changed files with 5 additions and 2 deletions
|
@ -52,6 +52,9 @@ variantToPyObject( const QVariant& variant )
|
||||||
case QVariant::Int:
|
case QVariant::Int:
|
||||||
return bp::object( variant.toInt() );
|
return bp::object( variant.toInt() );
|
||||||
|
|
||||||
|
case QVariant::LongLong:
|
||||||
|
return bp::object( variant.toLongLong() );
|
||||||
|
|
||||||
case QVariant::Double:
|
case QVariant::Double:
|
||||||
return bp::object( variant.toDouble() );
|
return bp::object( variant.toDouble() );
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ GeneralRequirements::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
|
|
||||||
if ( configurationMap.contains( "requiredStorage" ) &&
|
if ( configurationMap.contains( "requiredStorage" ) &&
|
||||||
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
|
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
|
||||||
configurationMap.value( "requiredStorage" ).type() == QVariant::Int ) )
|
configurationMap.value( "requiredStorage" ).type() == QVariant::LongLong ) )
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
m_requiredStorageGiB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
|
m_requiredStorageGiB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
|
||||||
|
@ -227,7 +227,7 @@ GeneralRequirements::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
|
|
||||||
if ( configurationMap.contains( "requiredRam" ) &&
|
if ( configurationMap.contains( "requiredRam" ) &&
|
||||||
( configurationMap.value( "requiredRam" ).type() == QVariant::Double ||
|
( configurationMap.value( "requiredRam" ).type() == QVariant::Double ||
|
||||||
configurationMap.value( "requiredRam" ).type() == QVariant::Int ) )
|
configurationMap.value( "requiredRam" ).type() == QVariant::LongLong ) )
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
m_requiredRamGiB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
m_requiredRamGiB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue