Skip to content
Permalink
Browse files

Merge pull request #604 from matthias-kuhn/wmsfix

Fix bad WMS server performance
  • Loading branch information
mhugent committed May 23, 2013
2 parents ac9736b + 700d12f commit d50214b1448fe1800b0556f208c4fb766042421e
Showing with 17 additions and 3 deletions.
  1. +5 −1 src/core/qgsmaplayerregistry.cpp
  2. +10 −0 src/core/qgsmaplayerregistry.h
  3. +2 −2 src/mapserver/qgswmsserver.cpp
@@ -130,12 +130,16 @@ void QgsMapLayerRegistry::removeMapLayers( QStringList theLayerIds )
}
}

void QgsMapLayerRegistry::clearMapLayers()
{
mMapLayers.clear();
} // QgsMapLayerRegistry::clearMapLayers()

void QgsMapLayerRegistry::removeMapLayer( const QString& theLayerId )
{
removeMapLayers( QStringList( theLayerId ) );
}


void QgsMapLayerRegistry::removeAllMapLayers()
{
emit removeAll();
@@ -96,6 +96,16 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
*/
QgsMapLayer* addMapLayer( QgsMapLayer * theMapLayer, bool addToLegend = true );

/**
* @brief
* Clears the map layer registry silently. No signals are emitted,
* no layer is deleted. Whatever this is suitable for... The WMS
* server makes use of this.
*
* Not available in python
*/
void clearMapLayers();

/**
* @brief
* Remove a set of layers from the registry
@@ -373,7 +373,7 @@ QImage* QgsWMSServer::getLegendGraphics()
currentY += layerSpace;
}

QgsMapLayerRegistry::instance()->removeAllMapLayers();
QgsMapLayerRegistry::instance()->clearMapLayers();
delete theImage;
return paintImage;
}
@@ -649,7 +649,7 @@ QImage* QgsWMSServer::getMap()
clearFeatureSelections( selectedLayerIdList );

QgsDebugMsg( "clearing filters" );
QgsMapLayerRegistry::instance()->removeAllMapLayers();
QgsMapLayerRegistry::instance()->clearMapLayers();

#ifdef QGISDEBUG
theImage->save( QDir::tempPath() + QDir::separator() + "lastrender.png" );

0 comments on commit d50214b

Please sign in to comment.
You can’t perform that action at this time.