@@ -152,8 +152,9 @@ void QgsLayerTreeViewDefaultActions::showInOverview()
152
152
QgsLayerTreeNode* node = mView ->currentNode ();
153
153
if ( !node )
154
154
return ;
155
-
156
- node->setCustomProperty ( " overview" , node->customProperty ( " overview" , 0 ).toInt () ? 0 : 1 );
155
+ int newValue = node->customProperty ( " overview" , 0 ).toInt ();
156
+ Q_FOREACH ( QgsLayerTreeLayer* l, mView ->selectedLayerNodes () )
157
+ l->setCustomProperty ( " overview" , newValue ? 0 : 1 );
157
158
}
158
159
159
160
void QgsLayerTreeViewDefaultActions::showFeatureCount ()
@@ -162,8 +163,9 @@ void QgsLayerTreeViewDefaultActions::showFeatureCount()
162
163
if ( !QgsLayerTree::isLayer ( node ) )
163
164
return ;
164
165
165
-
166
- node->setCustomProperty ( " showFeatureCount" , node->customProperty ( " showFeatureCount" , 0 ).toInt () ? 0 : 1 );
166
+ int newValue = node->customProperty ( " showFeatureCount" , 0 ).toInt ();
167
+ Q_FOREACH ( QgsLayerTreeLayer* l, mView ->selectedLayerNodes () )
168
+ l->setCustomProperty ( " showFeatureCount" , newValue ? 0 : 1 );
167
169
}
168
170
169
171
@@ -263,18 +265,16 @@ QString QgsLayerTreeViewDefaultActions::uniqueGroupName( QgsLayerTreeGroup* pare
263
265
264
266
void QgsLayerTreeViewDefaultActions::makeTopLevel ()
265
267
{
266
- QgsLayerTreeNode* node = mView ->currentNode ();
267
- if ( !node )
268
- return ;
269
-
270
- QgsLayerTreeGroup* rootGroup = mView ->layerTreeModel ()->rootGroup ();
271
- QgsLayerTreeGroup* parentGroup = qobject_cast<QgsLayerTreeGroup*>( node->parent () );
272
- if ( !parentGroup || parentGroup == rootGroup )
273
- return ;
274
-
275
- QgsLayerTreeNode* clonedNode = node->clone ();
276
- rootGroup->addChildNode ( clonedNode );
277
- parentGroup->removeChildNode ( node );
268
+ Q_FOREACH ( QgsLayerTreeLayer* l, mView ->selectedLayerNodes () )
269
+ {
270
+ QgsLayerTreeGroup* rootGroup = mView ->layerTreeModel ()->rootGroup ();
271
+ QgsLayerTreeGroup* parentGroup = qobject_cast<QgsLayerTreeGroup*>( l->parent () );
272
+ if ( !parentGroup || parentGroup == rootGroup )
273
+ continue ;
274
+ QgsLayerTreeLayer* clonedLayer = l->clone ();
275
+ rootGroup->addChildNode ( clonedLayer );
276
+ parentGroup->removeChildNode ( l );
277
+ }
278
278
}
279
279
280
280
0 commit comments