Skip to content
Permalink
Browse files

Do not check for geom equality when fixing a bad layer

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 7bf4e5b1198988d54d0e29d58ec61fdc5c112641
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsvectorlayer.cpp
@@ -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;

0 comments on commit 7bf4e5b

Please sign in to comment.
You can’t perform that action at this time.