From 404f07d4c0cd598f160aefd4ddc4bce57a1ba431 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sun, 10 Jun 2018 08:13:32 +1000 Subject: [PATCH] Remove foreach, initialize pointer --- src/app/qgslayertreeviewfilterindicator.cpp | 4 ++-- src/app/qgslayertreeviewfilterindicator.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/qgslayertreeviewfilterindicator.cpp b/src/app/qgslayertreeviewfilterindicator.cpp index 4bb2e260f78..3eb4e1163ba 100644 --- a/src/app/qgslayertreeviewfilterindicator.cpp +++ b/src/app/qgslayertreeviewfilterindicator.cpp @@ -175,7 +175,7 @@ void QgsLayerTreeViewFilterIndicatorProvider::addOrRemoveIndicator( QgsLayerTree const QList nodeIndicators = mLayerTreeView->indicators( node ); // maybe the indicator exists already - foreach ( QgsLayerTreeViewIndicator *indicator, nodeIndicators ) + for ( QgsLayerTreeViewIndicator *indicator : nodeIndicators ) { if ( mIndicators.contains( indicator ) ) { @@ -192,7 +192,7 @@ void QgsLayerTreeViewFilterIndicatorProvider::addOrRemoveIndicator( QgsLayerTree const QList 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 ) ) { diff --git a/src/app/qgslayertreeviewfilterindicator.h b/src/app/qgslayertreeviewfilterindicator.h index d681cf9805c..cf5bc7325c9 100644 --- a/src/app/qgslayertreeviewfilterindicator.h +++ b/src/app/qgslayertreeviewfilterindicator.h @@ -50,7 +50,7 @@ class QgsLayerTreeViewFilterIndicatorProvider : public QObject void addOrRemoveIndicator( QgsLayerTreeNode *node, QgsVectorLayer *vlayer ); private: - QgsLayerTreeView *mLayerTreeView; + QgsLayerTreeView *mLayerTreeView = nullptr; QIcon mIcon; QSet mIndicators; };