File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,16 @@ void QgsMapLayerRegistry::removeMapLayers( QStringList theLayerIds )
130
130
}
131
131
}
132
132
133
+ void QgsMapLayerRegistry::clearMapLayers ()
134
+ {
135
+ mMapLayers .clear ();
136
+ } // QgsMapLayerRegistry::clearMapLayers()
137
+
133
138
void QgsMapLayerRegistry::removeMapLayer ( const QString& theLayerId )
134
139
{
135
140
removeMapLayers ( QStringList ( theLayerId ) );
136
141
}
137
142
138
-
139
143
void QgsMapLayerRegistry::removeAllMapLayers ()
140
144
{
141
145
emit removeAll ();
Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
96
96
*/
97
97
QgsMapLayer* addMapLayer ( QgsMapLayer * theMapLayer, bool addToLegend = true );
98
98
99
+ /* *
100
+ * @brief
101
+ * Clears the map layer registry silently. No signals are emitted,
102
+ * no layer is deleted. Whatever this is suitable for... The WMS
103
+ * server makes use of this.
104
+ *
105
+ * Not available in python
106
+ */
107
+ void clearMapLayers ();
108
+
99
109
/* *
100
110
* @brief
101
111
* Remove a set of layers from the registry
Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ QImage* QgsWMSServer::getLegendGraphics()
373
373
currentY += layerSpace;
374
374
}
375
375
376
- QgsMapLayerRegistry::instance ()->removeAllMapLayers ();
376
+ QgsMapLayerRegistry::instance ()->clearMapLayers ();
377
377
delete theImage;
378
378
return paintImage;
379
379
}
@@ -649,7 +649,7 @@ QImage* QgsWMSServer::getMap()
649
649
clearFeatureSelections ( selectedLayerIdList );
650
650
651
651
QgsDebugMsg ( " clearing filters" );
652
- QgsMapLayerRegistry::instance ()->removeAllMapLayers ();
652
+ QgsMapLayerRegistry::instance ()->clearMapLayers ();
653
653
654
654
#ifdef QGISDEBUG
655
655
theImage->save ( QDir::tempPath () + QDir::separator () + " lastrender.png" );
You can’t perform that action at this time.
0 commit comments