[partition] Explain underlying type for flags variant
This commit is contained in:
parent
87c77d9807
commit
63964de4bd
@ -56,7 +56,11 @@ flags( const Partition* partition )
|
||||
{
|
||||
return partition->activeFlags();
|
||||
}
|
||||
if ( v.type() == QVariant::Int )
|
||||
// The underlying type of PartitionTable::Flags can be int or uint
|
||||
// (see qflags.h) and so setting those flags can create a QVariant
|
||||
// of those types; we don't just want to check QVariant::canConvert()
|
||||
// here because that will also accept QByteArray and some other things.
|
||||
if ( v.type() == QVariant::Int || v.type() == QVariant::UInt )
|
||||
{
|
||||
return static_cast< PartitionTable::Flags >( v.toInt() );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user