mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
Port away from most cases of Q_FOREACH to C++11 ranged for loop.
In order to avoid deep copies, Qt containers over which we iterate must be const The remaining unported cases require qAsConst (Qt 5.7) or std::as_const (C++17)
This commit is contained in:
parent
b0122f25e5
commit
9f0ca042fe
35 changed files with 105 additions and 92 deletions
|
@ -108,8 +108,8 @@ LocalePage::LocalePage( QWidget* parent )
|
|||
|
||||
m_zoneCombo->clear();
|
||||
|
||||
QList< LocaleGlobal::Location > zones = regions.value( m_regionCombo->currentData().toString() );
|
||||
foreach ( const LocaleGlobal::Location& zone, zones )
|
||||
const QList< LocaleGlobal::Location > zones = regions.value( m_regionCombo->currentData().toString() );
|
||||
for ( const LocaleGlobal::Location& zone : zones )
|
||||
{
|
||||
m_zoneCombo->addItem( LocaleGlobal::Location::pretty( zone.zone ), zone.zone );
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ LocalePage::init( const QString& initialRegion,
|
|||
auto containsLocation = []( const QList< LocaleGlobal::Location >& locations,
|
||||
const QString& zone ) -> bool
|
||||
{
|
||||
foreach ( const LocaleGlobal::Location& location, locations )
|
||||
for ( const LocaleGlobal::Location& location : locations )
|
||||
{
|
||||
if ( location.zone == zone )
|
||||
return true;
|
||||
|
@ -303,7 +303,8 @@ LocalePage::init( const QString& initialRegion,
|
|||
ba = supported.readAll();
|
||||
supported.close();
|
||||
|
||||
foreach ( QByteArray line, ba.split( '\n' ) )
|
||||
const auto lines = ba.split( '\n' );
|
||||
for ( const QByteArray &line : lines )
|
||||
{
|
||||
m_localeGenLines.append( QString::fromLatin1( line.simplified() ) );
|
||||
}
|
||||
|
@ -326,7 +327,8 @@ LocalePage::init( const QString& initialRegion,
|
|||
localeA.waitForFinished();
|
||||
ba = localeA.readAllStandardOutput();
|
||||
}
|
||||
foreach ( QByteArray line, ba.split( '\n' ) )
|
||||
const auto lines = ba.split( '\n' );
|
||||
for ( const QByteArray &line : lines )
|
||||
{
|
||||
if ( line.startsWith( "## " ) ||
|
||||
line.startsWith( "# " ) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue