Skip to content
Permalink
Browse files

fix forward and backward compatibility

  • Loading branch information
3nids committed Jan 4, 2021
1 parent 8d3ed86 commit e97927f31f66fdd5508df88432de5f562c40dce8
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/core/symbology/qgssymbollayerutils.cpp
@@ -1239,8 +1239,8 @@ QDomElement QgsSymbolLayerUtils::saveSymbol( const QString &name, const QgsSymbo
// if there are any paths in properties, convert them from absolute to relative
QgsApplication::symbolLayerRegistry()->resolvePaths( layer->layerType(), props, context.pathResolver(), true );

QDomElement propEl = doc.createElement( QStringLiteral( "prop" ) );
propEl.appendChild( QgsXmlUtils::writeVariant( props, doc ) );
saveProperties( props, doc, layerEl );

if ( layer->paintEffect() && !QgsPaintEffectRegistry::isDefaultStack( layer->paintEffect() ) )
layer->paintEffect()->saveProperties( doc, layerEl );

@@ -2951,7 +2951,7 @@ QgsStringMap QgsSymbolLayerUtils::getVendorOptionList( QDomElement &element )

QVariantMap QgsSymbolLayerUtils::parseProperties( const QDomElement &element )
{
QVariant newSymbols = QgsXmlUtils::readVariant( element ).toMap();
QVariant newSymbols = QgsXmlUtils::readVariant( element );
if ( newSymbols.type() == QVariant::Map )
{
return newSymbols.toMap();
@@ -2982,7 +2982,8 @@ void QgsSymbolLayerUtils::saveProperties( QVariantMap props, QDomDocument &doc,
element.appendChild( QgsXmlUtils::writeVariant( props, doc ) );

// -----
// let's do this to try to keep some backward compatibility to open project on QGIS <= 3.16
// let's do this to try to keep some backward compatibility
// to open a project saved on 3.18+ in QGIS <= 3.16
// TODO QGIS 4: remove
for ( QVariantMap::iterator it = props.begin(); it != props.end(); ++it )
{

0 comments on commit e97927f

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