Skip to content

Commit

Permalink
Code modernization
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 4, 2019
1 parent 6f075ca commit 86e3a8d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/app/layout/qgslayoutmanagerdialog.cpp
Expand Up @@ -94,12 +94,12 @@ QgsLayoutManagerDialog::QgsLayoutManagerDialog( QWidget *parent, Qt::WindowFlags

mUserTemplatesDir = QgsApplication::qgisSettingsDirPath() + "/composer_templates";
QMap<QString, QString> userTemplateMap = defaultTemplates( true );
this->addTemplates( userTemplateMap );
addTemplates( userTemplateMap );

mDefaultTemplatesDir = QgsApplication::pkgDataPath() + "/composer_templates";
QMap<QString, QString> defaultTemplateMap = defaultTemplates( false );
this->addTemplates( defaultTemplateMap );
this->addTemplates( this->otherTemplates() );
addTemplates( defaultTemplateMap );
addTemplates( otherTemplates() );

toggleButtons();
}
Expand Down Expand Up @@ -186,13 +186,12 @@ QMap<QString, QString> QgsLayoutManagerDialog::templatesFromPath( const QString
return templateMap;
}

QFileInfoList fileInfoList = templateDir.entryInfoList( QDir::Files );
QFileInfoList::const_iterator infoIt = fileInfoList.constBegin();
for ( ; infoIt != fileInfoList.constEnd(); ++infoIt )
const QFileInfoList fileInfoList = templateDir.entryInfoList( QDir::Files );
for ( const QFileInfo &info : fileInfoList )
{
if ( infoIt->suffix().compare( QLatin1String( "qpt" ), Qt::CaseInsensitive ) == 0 )
if ( info.suffix().compare( QLatin1String( "qpt" ), Qt::CaseInsensitive ) == 0 )
{
templateMap.insert( infoIt->baseName(), infoIt->absoluteFilePath() );
templateMap.insert( info.baseName(), info.absoluteFilePath() );
}
}
return templateMap;
Expand Down

0 comments on commit 86e3a8d

Please sign in to comment.