[libcalamares] Handle qlonglong when writing YAML
- Handle qlonglong explicitly - Add a fallbackfor things that convert to qulonglong, to avoid these remaining integer types from hitting the very end of the if-chain, and being written out as the **string** "<typename>"
This commit is contained in:
parent
c6463a30ea
commit
3b354b8b20
@ -260,10 +260,20 @@ dumpYamlElement( QFile& f, const QVariant& value, int indent )
|
||||
{
|
||||
f.write( QString::number( value.toInt() ).toUtf8() );
|
||||
}
|
||||
else if ( value.type() == QVariant::Type::LongLong )
|
||||
{
|
||||
f.write( QString::number( value.toLongLong() ).toUtf8() );
|
||||
}
|
||||
else if ( value.type() == QVariant::Type::Double )
|
||||
{
|
||||
f.write( QString::number( value.toDouble() ).toUtf8() );
|
||||
}
|
||||
else if ( value.canConvert( QVariant::Type::ULongLong ) )
|
||||
{
|
||||
// This one needs to be *after* bool, int, double to avoid this branch
|
||||
// .. grabbing those convertible types un-necessarily.
|
||||
f.write( QString::number( value.toULongLong() ).toUtf8() );
|
||||
}
|
||||
else if ( value.type() == QVariant::Type::List )
|
||||
{
|
||||
int c = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user