Skip to content

Commit

Permalink
Range based for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent d299c68 commit 8e7db54
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,15 +1164,13 @@ int main( int argc, char *argv[] )
/////////////////////////////////////////////////////////////////////
// autoload any file names that were passed in on the command line
/////////////////////////////////////////////////////////////////////
QgsDebugMsg( QString( "Number of files in myFileList: %1" ).arg( sFileList.count() ) );
for ( QStringList::Iterator myIterator = sFileList.begin(); myIterator != sFileList.end(); ++myIterator )
for ( const QString &layerName : qgsAsConst( sFileList ) )
{
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( ( *myIterator ) ) );
QString myLayerName = *myIterator;
QgsDebugMsg( QString( "Trying to load file : %1" ).arg( layerName ) );
// don't load anything with a .qgs extension - these are project files
if ( !myLayerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
if ( !layerName.endsWith( QLatin1String( ".qgs" ), Qt::CaseInsensitive ) )
{
qgis->openLayer( myLayerName );
qgis->openLayer( layerName );
}
}

Expand Down

0 comments on commit 8e7db54

Please sign in to comment.