Remove foreach, initialize pointer

This commit is contained in:
Nyall Dawson 2018-06-10 08:13:32 +10:00
parent 0a325f1eda
commit 404f07d4c0
2 changed files with 3 additions and 3 deletions

View File

@ -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 ) )
{
@ -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 ) )
{

View File

@ -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;
};