1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

clazy: loop over containers

This commit is contained in:
fb 2022-11-15 21:22:16 +01:00
parent fe8f205b50
commit 6d53c16ed0
3 changed files with 5 additions and 5 deletions

View File

@ -206,10 +206,10 @@ void DockInDockWidget::fillPerspectivesMenu( QMenu* menu )
if ( !perspectiveNames.isEmpty() ) if ( !perspectiveNames.isEmpty() )
{ {
QMenu* load = menu->addMenu( "Load perspective" ); QMenu* load = menu->addMenu( "Load perspective" );
for ( auto name : perspectiveNames ) for ( const QString& name : perspectiveNames )
load->addAction( new LoadPerspectiveAction( load, name, *this ) ); load->addAction( new LoadPerspectiveAction( load, name, *this ) );
QMenu* remove = menu->addMenu( "Remove perspective" ); QMenu* remove = menu->addMenu( "Remove perspective" );
for ( auto name : perspectiveNames ) for ( const QString& name : perspectiveNames )
remove->addAction( new RemovePerspectiveAction( remove, name, *this ) ); remove->addAction( new RemovePerspectiveAction( remove, name, *this ) );
} }
} }

View File

@ -21,7 +21,7 @@ PerspectivesManager::PerspectivesManager( const QString& perspectivesFolder ) :
PerspectivesManager::~PerspectivesManager() PerspectivesManager::~PerspectivesManager()
{ {
// remove temp files: // remove temp files:
for ( auto perspective : m_perspectives ) for ( auto& perspective : m_perspectives )
{ {
QString fileName = perspective.settings->fileName(); QString fileName = perspective.settings->fileName();
perspective.settings.reset(); perspective.settings.reset();
@ -219,7 +219,7 @@ void PerspectivesManager::loadPerspectives()
// load group info: // load group info:
mainSettings->beginGroup(GROUP_PREFIX); mainSettings->beginGroup(GROUP_PREFIX);
for ( auto key : mainSettings->allKeys() ) for ( const QString& key : mainSettings->allKeys() )
m_perspectives[perspective].groups[key] = mainSettings->value( key ).toStringList(); m_perspectives[perspective].groups[key] = mainSettings->value( key ).toStringList();
mainSettings->endGroup(); mainSettings->endGroup();
} }

View File

@ -928,7 +928,7 @@ void CDockManager::removePerspective(const QString& Name)
void CDockManager::removePerspectives(const QStringList& Names) void CDockManager::removePerspectives(const QStringList& Names)
{ {
int Count = 0; int Count = 0;
for (auto Name : Names) for (const QString& Name : Names)
{ {
Count += d->Perspectives.remove(Name); Count += d->Perspectives.remove(Name);
} }