Skip to content

Commit

Permalink
[BUGFIX][Server] Filter restorer modifying layers and not well restor…
Browse files Browse the repository at this point in the history
…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 c869fa2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/qgsfilterrestorer.cpp
Expand Up @@ -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" ) );
}
}
}
Expand Down

0 comments on commit c869fa2

Please sign in to comment.