Skip to content

Commit

Permalink
When changing layer data paths through the layer tree menu, ensure
Browse files Browse the repository at this point in the history
that existing subset strings are correctly applied after the layer
path is changed

Previously this only worked when repairing a broken layer path, but
we should also maintain the filter when a valid layer's path is changed.

(cherry picked from commit 7dfa842)
  • Loading branch information
nyalldawson authored and nirvn committed Jan 13, 2020
1 parent cb8b8bc commit 1751d8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -7380,7 +7380,7 @@ void QgisApp::changeDataSource( QgsMapLayer *layer )
QString subsetString;
// Get the subset string directly from the data provider because
// layer's method will return a null string from invalid layers
if ( !layerWasValid && vlayer && vlayer->dataProvider() &&
if ( vlayer && vlayer->dataProvider() &&
vlayer->dataProvider()->supportsSubsetString() &&
!vlayer->dataProvider()->subsetString( ).isEmpty() )
{
Expand Down

0 comments on commit 1751d8e

Please sign in to comment.