[plasmalnf] Fix iteration

`for k : images` iterates over the values in the map, while we need
both the key (the theme-id) and the value (the image to hand to
that theme).
This commit is contained in:
Adriaan de Groot 2020-11-30 12:29:47 +01:00
parent bcff0454a3
commit fb9fa347a0

View File

@ -183,9 +183,9 @@ ThemesModel::setThemeImage( const QMap< QString, QString >& images )
// Don't emit signals from each call, aggregate to one call (below this block) // Don't emit signals from each call, aggregate to one call (below this block)
{ {
QSignalBlocker b( this ); QSignalBlocker b( this );
for ( const auto& k : images ) for ( auto k = images.constKeyValueBegin(); k != images.constKeyValueEnd(); ++k )
{ {
setThemeImage( k, images[ k ] ); setThemeImage( k->first, k->second );
} }
} }
emit dataChanged( index( 0, 0 ), index( m_themes->count() - 1 ), { ImageRole } ); emit dataChanged( index( 0, 0 ), index( m_themes->count() - 1 ), { ImageRole } );