Skip to content

Commit

Permalink
Add const to lists and remove redundant condition
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Aug 18, 2019
1 parent 2f5d544 commit aa0f3e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/qgscustomization.cpp
Expand Up @@ -610,7 +610,7 @@ void QgsCustomization::createTreeItemToolbars()
tbItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable );
tbItem->setCheckState( 0, Qt::Checked );

QList<QWidgetAction *> tbWidgetActions = tb->findChildren<QWidgetAction *>( QString(), Qt::FindDirectChildrenOnly );
const QList<QWidgetAction *> tbWidgetActions = tb->findChildren<QWidgetAction *>( QString(), Qt::FindDirectChildrenOnly );
QList<QAction *> tbActions = tb->actions();

for ( QAction *act : tbWidgetActions )
Expand All @@ -624,7 +624,7 @@ void QgsCustomization::createTreeItemToolbars()

QWidgetAction *widgetAction = qobject_cast<QWidgetAction *>( act );
QWidget *widget = widgetAction->defaultWidget();
QList<QAction *> childActions = widget->actions();
const QList<QAction *> childActions = widget->actions();
addTreeItemActions( item, childActions );

tbActions.removeAll( act );
Expand Down Expand Up @@ -772,12 +772,12 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
continue;
}

if ( visible && action->metaObject()->className() == QStringLiteral( "QWidgetAction" ) )
if ( action->metaObject()->className() == QStringLiteral( "QWidgetAction" ) )
{
mSettings->beginGroup( action->objectName() );
QWidgetAction *widgetAction = qobject_cast<QWidgetAction *>( action );
QWidget *widget = widgetAction->defaultWidget();
QList<QAction *> childActions = widget->actions();
const QList<QAction *> childActions = widget->actions();
for ( QAction *wAction : childActions )
{
if ( wAction->objectName().isEmpty() )
Expand Down

0 comments on commit aa0f3e1

Please sign in to comment.