@ -76,6 +76,50 @@ getLuksUuid( const QString& path )
return uuid ;
}
// TODO: this will be available from KPMCore soon
static const char * filesystem_labels [ ] = {
" unknown " ,
" extended " ,
" ext2 " ,
" ext3 " ,
" ext4 " ,
" linuxswap " ,
" fat16 " ,
" fat32 " ,
" ntfs " ,
" reiser " ,
" reiser4 " ,
" xfs " ,
" jfs " ,
" hfs " ,
" hfsplus " ,
" ufs " ,
" unformatted " ,
" btrfs " ,
" hpfs " ,
" luks " ,
" ocfs2 " ,
" zfs " ,
" exfat " ,
" nilfs2 " ,
" lvm2 pv " ,
" f2fs " ,
" udf " ,
" iso9660 " ,
} ;
Q_STATIC_ASSERT_X ( ( sizeof ( filesystem_labels ) / sizeof ( char * ) ) > = FileSystem : : __lastType , " Mismatch in filesystem labels " ) ;
static QString
untranslatedTypeName ( FileSystem : : Type t )
{
Q_ASSERT ( t > = 0 ) ;
Q_ASSERT ( t < = FileSystem : : __lastType ) ;
return QLatin1String ( filesystem_labels [ t ] ) ;
}
static QVariant
mapForPartition ( Partition * partition , const QString & uuid )
@ -83,14 +127,15 @@ mapForPartition( Partition* partition, const QString& uuid )
QVariantMap map ;
map [ " device " ] = partition - > partitionPath ( ) ;
map [ " mountPoint " ] = PartitionInfo : : mountPoint ( partition ) ;
map [ " fs " ] = partition - > fileSystem ( ) . name ( ) ;
map [ " fsName " ] = partition - > fileSystem ( ) . name ( ) ;
map [ " fs " ] = untranslatedTypeName ( partition - > fileSystem ( ) . type ( ) ) ;
if ( partition - > fileSystem ( ) . type ( ) = = FileSystem : : Luks & &
dynamic_cast < FS : : luks & > ( partition - > fileSystem ( ) ) . innerFS ( ) )
map [ " fs " ] = dynamic_cast < FS : : luks & > ( partition - > fileSystem ( ) ) . innerFS ( ) - > name ( ) ;
map [ " uuid " ] = uuid ;
cDebug ( ) < < partition - > partitionPath ( )
< < " mtpoint: " < < PartitionInfo : : mountPoint ( partition )
< < " fs: " < < map [ " fs " ]
< < " fs: " < < map [ " fs " ] < < ' ( ' < < map [ " fsName " ] < < ' ) '
< < uuid ;
if ( partition - > roles ( ) . has ( PartitionRole : : Luks ) )