Skip to content

Commit

Permalink
Do not check for geom equality when fixing a bad layer
Browse files Browse the repository at this point in the history
re-apply the style with no checks for geometry type

This is a temporary workaround, the solution will probably
need some storage for the original geometry type.
  • Loading branch information
elpaso committed Nov 6, 2018
1 parent 36f1158 commit 7bf4e5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1500,8 +1500,8 @@ void QgsVectorLayer::setDataSource( const QString &dataSource, const QString &ba
// Always set crs
setCoordinateSystem();

// reset style if loading default style, style is missing, or geometry type has changed
if ( !renderer() || !legend() || geomType != geometryType() || loadDefaultStyleFlag )
// reset style if loading default style, style is missing, or geometry type is has changed (and layer is valid)
if ( !renderer() || !legend() || ( mValid && geomType != geometryType() ) || loadDefaultStyleFlag )
{
bool defaultLoadedFlag = false;

Expand Down

0 comments on commit 7bf4e5b

Please sign in to comment.