Skip to content
Permalink
Browse files

Use remove_if

  • Loading branch information
pblottiere committed Mar 18, 2019
1 parent dad5b75 commit 63c02783803211387b8e9c2867d6a3285360152d
Showing with 8 additions and 7 deletions.
  1. +6 −6 src/server/services/wms/qgswmsparameters.cpp
  2. +2 −1 src/server/services/wms/qgswmsparameters.h
@@ -1502,12 +1502,12 @@ namespace QgsWms
{
QList<QgsWmsParametersExternalLayer> externalLayers;

for ( const QString &layer : allLayersNickname() )
{
if ( ! isExternalLayer( layer ) )
continue;
QStringList layers = allLayersNickname();
QStringList::const_iterator rit = std::remove_if( layers.begin(), layers.end(), QgsWmsParameters::isExternalLayer );

externalLayers << externalLayerParameter( layer );
for ( QStringList::const_iterator it = layers.begin(); it != rit; ++it )
{
externalLayers << externalLayerParameter( *it );
}

return externalLayers;
@@ -1813,7 +1813,7 @@ namespace QgsWms
return param;
}

bool QgsWmsParameters::isExternalLayer( const QString &name ) const
bool QgsWmsParameters::isExternalLayer( const QString &name )
{
return name.startsWith( EXTERNAL_LAYER_PREFIX );
}
@@ -1178,6 +1178,8 @@ namespace QgsWms
QStringList atlasPk() const;

private:
static bool isExternalLayer( const QString &name );

bool loadParameter( const QString &name, const QString &value ) override;

void save( const QgsWmsParameter &parameter, bool multi = false );
@@ -1187,7 +1189,6 @@ namespace QgsWms
void raiseError( const QString &msg ) const;
void log( const QString &msg ) const;

bool isExternalLayer( const QString &name ) const;
QgsWmsParametersExternalLayer externalLayerParameter( const QString &name ) const;

QMultiMap<QString, QgsWmsParametersFilter> layerFilters( const QStringList &layers ) const;

0 comments on commit 63c0278

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