Skip to content
Permalink
Browse files
[BUGFIX][Server] QgsOWSServer restorer modifying layers and not well …
…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 b464da837c3c40e12258a6a9a524d4ce9283d31c
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/server/qgsowsserver.cpp
@@ -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" );
}
}
}

0 comments on commit b464da8

Please sign in to comment.