[libcalamares] TZRegionModel gets a data role
This commit is contained in:
parent
97235e9b3d
commit
2625bb18df
@ -165,7 +165,7 @@ TZRegionModel::rowCount( const QModelIndex& parent ) const
|
|||||||
QVariant
|
QVariant
|
||||||
TZRegionModel::data( const QModelIndex& index, int role ) const
|
TZRegionModel::data( const QModelIndex& index, int role ) const
|
||||||
{
|
{
|
||||||
if ( role != LabelRole )
|
if ( ( role != LabelRole ) && ( role != Qt::UserRole ) )
|
||||||
{
|
{
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ TZRegionModel::data( const QModelIndex& index, int role ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TZRegion& region = m_regions.at( index.row() );
|
const TZRegion& region = m_regions.at( index.row() );
|
||||||
return region.tr();
|
return role == LabelRole ? region.tr() : region.key();
|
||||||
}
|
}
|
||||||
|
|
||||||
const TZRegion&
|
const TZRegion&
|
||||||
|
Loading…
Reference in New Issue
Block a user