Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layout][server] Const correctnes and typos
  • Loading branch information
elpaso committed Jan 10, 2018
1 parent a117b6b commit ba5b88c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -458,7 +458,7 @@ namespace QgsWms
// Layout maps now use a string UUID as "id", let's assume that the first map
// has id 0 and so on ...
int mapId = 0;
for ( auto &map : maps )
for ( const auto &map : qgis::as_const( maps ) )
{
QgsWmsParametersComposerMap cMapParams = mWmsParameters.composerMapParameters( mapId );
mapId++;
Expand All @@ -467,8 +467,7 @@ namespace QgsWms
if ( !cMapParams.mHasExtent )
{
//remove map from composition if not referenced by the request
c->removeItem( map );
delete map;
c->removeLayoutItem( map );
continue;
}
// Change CRS of map set to "project CRS" to match requested CRS
Expand Down Expand Up @@ -547,7 +546,7 @@ namespace QgsWms
// Labels
QList<QgsLayoutItemLabel *> labels;
c->layoutItems<QgsLayoutItemLabel>( labels );
for ( auto &label : labels )
for ( const auto &label : qgis::as_const( labels ) )
{
QString labelId = label->id().toUpper();
if ( !mParameters.contains( labelId ) )
Expand All @@ -569,7 +568,7 @@ namespace QgsWms
// HTMLs
QList<QgsLayoutItemHtml *> htmls;
c->layoutObjects<QgsLayoutItemHtml>( htmls );
for ( auto &html : htmls )
for ( const auto &html : qgis::as_const( htmls ) )
{
if ( html->frameCount() == 0 )
continue;
Expand Down Expand Up @@ -600,7 +599,7 @@ namespace QgsWms
// legends
QList<QgsLayoutItemLegend *> legends;
c->layoutItems<QgsLayoutItemLegend>( legends );
for ( auto &legend : legends )
for ( const auto &legend : qgis::as_const( legends ) )
{
if ( legend->autoUpdateModel() )
{
Expand All @@ -617,7 +616,8 @@ namespace QgsWms
// get model and layer tree root of the legend
QgsLegendModel *model = legend->model();
QStringList layerSet;
for ( const auto &layer : map->layers() )
const QList<QgsMapLayer *> layerList( map->layers() );
for ( const auto &layer : layerList )
layerSet << layer->id();

//setLayerIdsToLegendModel( model, layerSet, map->scale() );
Expand All @@ -626,7 +626,7 @@ namespace QgsWms
QgsLayerTree *root = model->rootGroup();

// get layerIds find in the layer tree root
QStringList layerIds = root->findLayerIds();
const QStringList layerIds = root->findLayerIds();

// find the layer in the layer tree
// remove it if the layer id is not in map layerIds
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/qgis_wrapped_server.py
Expand Up @@ -13,7 +13,7 @@
Note that multi threading in QGIS server is not officially supported and
it is not supposed to work in any case
Set MULTITHREADING environment varialbe to 1 to activate.
Set MULTITHREADING environment variable to 1 to activate.
For testing purposes, HTTP Basic can be enabled by setting the following
Expand Down

0 comments on commit ba5b88c

Please sign in to comment.