Fix various clazy warnings

This commit is contained in:
Uwe Kindler 2022-11-18 21:36:31 +01:00
parent ca1d3fcd38
commit 8d30fc9c3c
5 changed files with 13 additions and 9 deletions

View File

@ -206,11 +206,15 @@ 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 auto& 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 auto& name : perspectiveNames)
remove->addAction( new RemovePerspectiveAction( remove, name, *this ) ); {
remove->addAction( new RemovePerspectiveAction( remove, name, *this ));
}
} }
} }

View File

@ -219,8 +219,10 @@ void PerspectivesManager::loadPerspectives()
// load group info: // load group info:
mainSettings->beginGroup(GROUP_PREFIX); mainSettings->beginGroup(GROUP_PREFIX);
for ( auto key : mainSettings->allKeys() ) for (const auto& 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();
} }
else else

View File

@ -1010,7 +1010,7 @@ bool CDockAreaWidget::isCentralWidgetArea() const
return false; return false;
} }
return dockManager()->centralWidget() == dockWidgets()[0]; return dockManager()->centralWidget() == dockWidgets().constFirst();
} }

View File

@ -568,7 +568,6 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin
} }
else else
{ {
QList<int> NewSplitterSizes;
QSplitter* NewSplitter = newSplitter(InsertParam.orientation()); QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height(); int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height();
bool AdjustSplitterSizes = true; bool AdjustSplitterSizes = true;
@ -692,7 +691,6 @@ void DockContainerWidgetPrivate::moveToNewSection(QWidget* Widget, CDockAreaWidg
} }
else else
{ {
auto Sizes = TargetAreaSplitter->sizes();
int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height(); int TargetAreaSize = (InsertParam.orientation() == Qt::Horizontal) ? TargetArea->width() : TargetArea->height();
QSplitter* NewSplitter = newSplitter(InsertParam.orientation()); QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
NewSplitter->addWidget(TargetArea); NewSplitter->addWidget(TargetArea);

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 auto& Name : Names)
{ {
Count += d->Perspectives.remove(Name); Count += d->Perspectives.remove(Name);
} }