Skip to content

Commit

Permalink
Fix various clazy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
githubuser0xFFFF committed Nov 18, 2022
1 parent ca1d3fc commit 8d30fc9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions examples/dockindock/dockindock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,15 @@ void DockInDockWidget::fillPerspectivesMenu( QMenu* menu )
if ( !perspectiveNames.isEmpty() )
{
QMenu* load = menu->addMenu( "Load perspective" );
for ( auto name : perspectiveNames )
load->addAction( new LoadPerspectiveAction( load, name, *this ) );
for (const auto& name : perspectiveNames)
{
load->addAction(new LoadPerspectiveAction( load, name, *this));
}
QMenu* remove = menu->addMenu( "Remove perspective" );
for ( auto name : perspectiveNames )
remove->addAction( new RemovePerspectiveAction( remove, name, *this ) );
for (const auto& name : perspectiveNames)
{
remove->addAction( new RemovePerspectiveAction( remove, name, *this ));
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion examples/dockindock/perspectives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ void PerspectivesManager::loadPerspectives()

// load group info:
mainSettings->beginGroup(GROUP_PREFIX);
for ( auto key : mainSettings->allKeys() )
for (const auto& key : mainSettings->allKeys())
{
m_perspectives[perspective].groups[key] = mainSettings->value( key ).toStringList();
}
mainSettings->endGroup();
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/DockAreaWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ bool CDockAreaWidget::isCentralWidgetArea() const
return false;
}

return dockManager()->centralWidget() == dockWidgets()[0];
return dockManager()->centralWidget() == dockWidgets().constFirst();
}


Expand Down
2 changes: 0 additions & 2 deletions src/DockContainerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin
}
else
{
QList<int> NewSplitterSizes;
QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height();
bool AdjustSplitterSizes = true;
Expand Down Expand Up @@ -692,7 +691,6 @@ void DockContainerWidgetPrivate::moveToNewSection(QWidget* Widget, CDockAreaWidg
}
else
{
auto Sizes = TargetAreaSplitter->sizes();
int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height();
QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
NewSplitter->addWidget(TargetArea);
Expand Down
2 changes: 1 addition & 1 deletion src/DockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ void CDockManager::removePerspective(const QString& Name)
void CDockManager::removePerspectives(const QStringList& Names)
{
int Count = 0;
for (auto Name : Names)
for (const auto& Name : Names)
{
Count += d->Perspectives.remove(Name);
}
Expand Down

0 comments on commit 8d30fc9

Please sign in to comment.