Skip to content
Permalink
Browse files

Range based for loop

  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent d299c68 commit 8e7db5488fd8586885e062f5b055396b9b916a66
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/app/main.cpp
@@ -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 );
}
}

0 comments on commit 8e7db54

Please sign in to comment.
You can’t perform that action at this time.