Skip to content
Permalink
Browse files
[BUGFIX][Server] Filter restorer modifying layers and not well restor…
…ing 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 25, 2017
1 parent 70a21d4 commit c869fa29b6d8ab5d6f47196743f23422fe40e30e
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/server/qgsfilterrestorer.cpp
@@ -61,10 +61,9 @@ void QgsOWSServerFilterRestorer::restoreLayerFilters( const QHash<QgsMapLayer *,
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( QStringLiteral( "Layer does not support Subset String" ) );
}
}
}

0 comments on commit c869fa2

Please sign in to comment.