Skip to content

Commit

Permalink
Merge pull request #35219 from mhugent/fix_absolute_path_qlr
Browse files Browse the repository at this point in the history
Fix absolute paths in qlr export (bug #27497)
  • Loading branch information
mhugent committed Mar 22, 2020
2 parents 2c01373 + 132e674 commit f7d09d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgslayerdefinition.cpp
Expand Up @@ -210,7 +210,8 @@ bool QgsLayerDefinition::exportLayerDefinition( QString path, const QList<QgsLay
}

QgsReadWriteContext context;
context.setPathResolver( QgsPathResolver( path ) );
bool writeAbsolutePath = QgsProject::instance()->readBoolEntry( QStringLiteral( "Paths" ), QStringLiteral( "/Absolute" ), false );
context.setPathResolver( QgsPathResolver( writeAbsolutePath ? QString() : path ) );

QDomDocument doc( QStringLiteral( "qgis-layer-definition" ) );
if ( !exportLayerDefinition( doc, selectedTreeNodes, errorMessage, context ) )
Expand Down

0 comments on commit f7d09d9

Please sign in to comment.