Skip to content

Commit df19fe5

Browse files
committedMay 17, 2013
Fix wmsserver: Do not manipulate maplayerregistry directly
1 parent 55556fc commit df19fe5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/mapserver/qgswmsserver.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ QImage* QgsWMSServer::getLegendGraphics()
373373
currentY += layerSpace;
374374
}
375375

376-
QgsMapLayerRegistry::instance()->mapLayers().clear();
376+
QgsMapLayerRegistry::instance()->removeAllMapLayers();
377377
delete theImage;
378378
return paintImage;
379379
}
@@ -649,7 +649,7 @@ QImage* QgsWMSServer::getMap()
649649
clearFeatureSelections( selectedLayerIdList );
650650

651651
QgsDebugMsg( "clearing filters" );
652-
QgsMapLayerRegistry::instance()->mapLayers().clear();
652+
QgsMapLayerRegistry::instance()->removeAllMapLayers();
653653

654654
#ifdef QGISDEBUG
655655
theImage->save( QDir::tempPath() + QDir::separator() + "lastrender.png" );
@@ -1926,7 +1926,7 @@ QStringList QgsWMSServer::applyFeatureSelections( const QStringList& layerList )
19261926

19271927
void QgsWMSServer::clearFeatureSelections( const QStringList& layerIds ) const
19281928
{
1929-
QMap<QString, QgsMapLayer*>& layerMap = QgsMapLayerRegistry::instance()->mapLayers();
1929+
const QMap<QString, QgsMapLayer*>& layerMap = QgsMapLayerRegistry::instance()->mapLayers();
19301930

19311931
foreach ( QString id, layerIds )
19321932
{

0 commit comments

Comments
 (0)
Please sign in to comment.