Skip to content

Commit e3de218

Browse files
committedSep 29, 2017
Range based for loop
1 parent 95a392b commit e3de218

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
 

‎src/app/main.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,15 +1164,13 @@ int main( int argc, char *argv[] )
11641164
/////////////////////////////////////////////////////////////////////
11651165
// autoload any file names that were passed in on the command line
11661166
/////////////////////////////////////////////////////////////////////
1167-
QgsDebugMsg( QString( "Number of files in myFileList: %1" ).arg( sFileList.count() ) );
1168-
for ( QStringList::Iterator myIterator = sFileList.begin(); myIterator != sFileList.end(); ++myIterator )
1167+
for ( const QString &layerName : qgsAsConst( sFileList ) )
11691168
{
1170-
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
1171-
QString myLayerName = *myIterator;
1169+
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( layerName ) );
11721170
// don't load anything with a .qgs extension - these are project files
1173-
if ( !myLayerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
1171+
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
11741172
{
1175-
qgis->openLayer( myLayerName );
1173+
qgis->openLayer( layerName );
11761174
}
11771175
}
11781176

0 commit comments

Comments
 (0)
Please sign in to comment.