Skip to content

Commit

Permalink
Remove foreach, initialize pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 11, 2018
1 parent 0a325f1 commit 404f07d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/qgslayertreeviewfilterindicator.cpp
Expand Up @@ -175,7 +175,7 @@ void QgsLayerTreeViewFilterIndicatorProvider::addOrRemoveIndicator( QgsLayerTree
const QList<QgsLayerTreeViewIndicator *> nodeIndicators = mLayerTreeView->indicators( node );

// maybe the indicator exists already
foreach ( QgsLayerTreeViewIndicator *indicator, nodeIndicators )
for ( QgsLayerTreeViewIndicator *indicator : nodeIndicators )
{
if ( mIndicators.contains( indicator ) )
{
Expand All @@ -192,7 +192,7 @@ void QgsLayerTreeViewFilterIndicatorProvider::addOrRemoveIndicator( QgsLayerTree
const QList<QgsLayerTreeViewIndicator *> nodeIndicators = mLayerTreeView->indicators( node );

// there may be existing indicator we need to get rid of
foreach ( QgsLayerTreeViewIndicator *indicator, nodeIndicators )
for ( QgsLayerTreeViewIndicator *indicator : nodeIndicators )
{
if ( mIndicators.contains( indicator ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgslayertreeviewfilterindicator.h
Expand Up @@ -50,7 +50,7 @@ class QgsLayerTreeViewFilterIndicatorProvider : public QObject
void addOrRemoveIndicator( QgsLayerTreeNode *node, QgsVectorLayer *vlayer );

private:
QgsLayerTreeView *mLayerTreeView;
QgsLayerTreeView *mLayerTreeView = nullptr;
QIcon mIcon;
QSet<QgsLayerTreeViewIndicator *> mIndicators;
};
Expand Down

0 comments on commit 404f07d

Please sign in to comment.