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:
Andrius Štikonas 2016-09-01 13:21:05 +01:00
parent b0122f25e5
commit 9f0ca042fe
35 changed files with 105 additions and 92 deletions

View file

@ -95,10 +95,10 @@ ViewModule::initFrom( const QVariantMap& moduleDescriptor )
// If a load path is not specified, we look for a plugin to load in the directory.
if ( load.isEmpty() || !QLibrary::isLibrary( load ) )
{
QStringList ls = directory.entryList( QStringList{ "*.so" } );
const QStringList ls = directory.entryList( QStringList{ "*.so" } );
if ( !ls.isEmpty() )
{
foreach ( QString entry, ls )
for ( QString entry : ls )
{
entry = directory.absoluteFilePath( entry );
if ( QLibrary::isLibrary( entry ) )