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.
This commit is contained in:
Alessandro Pasotti 2018-11-06 14:55:13 +01:00
parent 36f115833e
commit 7bf4e5b119

View File

@ -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;