Skip to content

Commit 404f07d

Browse files
committed
Remove foreach, initialize pointer
1 parent 0a325f1 commit 404f07d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app/qgslayertreeviewfilterindicator.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void QgsLayerTreeViewFilterIndicatorProvider::addOrRemoveIndicator( QgsLayerTree
175175
const QList<QgsLayerTreeViewIndicator *> nodeIndicators = mLayerTreeView->indicators( node );
176176

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

194194
// there may be existing indicator we need to get rid of
195-
foreach ( QgsLayerTreeViewIndicator *indicator, nodeIndicators )
195+
for ( QgsLayerTreeViewIndicator *indicator : nodeIndicators )
196196
{
197197
if ( mIndicators.contains( indicator ) )
198198
{

src/app/qgslayertreeviewfilterindicator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class QgsLayerTreeViewFilterIndicatorProvider : public QObject
5050
void addOrRemoveIndicator( QgsLayerTreeNode *node, QgsVectorLayer *vlayer );
5151

5252
private:
53-
QgsLayerTreeView *mLayerTreeView;
53+
QgsLayerTreeView *mLayerTreeView = nullptr;
5454
QIcon mIcon;
5555
QSet<QgsLayerTreeViewIndicator *> mIndicators;
5656
};

0 commit comments

Comments
 (0)