Skip to content

Commit

Permalink
[BUGFIX][Server] QgsOWSServer restorer modifying layers and not well …
Browse files Browse the repository at this point in the history
…restoring them

The Subsetstring is updated through QgsVectorLayer::setSubsetString and restored by QgsVectorDataProvider::setSubsetString and it's not idempotent.
The solution is to use QgsVectorLayer::setSubsetString in the 2 cases.
  • Loading branch information
rldhont committed Apr 27, 2017
1 parent 8e3e30a commit b464da8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/qgsowsserver.cpp
Expand Up @@ -57,10 +57,9 @@ void QgsOWSServer::restoreLayerFilters( const QHash<QgsMapLayer*, QString>& filt
QgsVectorLayer* filteredLayer = qobject_cast<QgsVectorLayer*>( filterIt.key() );
if ( filteredLayer )
{
QgsVectorDataProvider* dp = filteredLayer->dataProvider();
if ( dp )
if ( !filteredLayer->setSubsetString( filterIt.value() ) )
{
dp->setSubsetString( filterIt.value() );
QgsMessageLog::logMessage( "Layer does not support Subset String" );
}
}
}
Expand Down

0 comments on commit b464da8

Please sign in to comment.