Skip to content

Commit a3312b6

Browse files
author
mhugent
committedJan 20, 2010
Save path for svg texture absolute or relative
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12807 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/core/symbology-ng/qgsfillsymbollayerv2.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::clone() const
8686
//QgsSVGFillSymbolLayer
8787
#include <QFile>
8888
#include <QSvgRenderer>
89+
#include "qgsproject.h" //for absolute/relative file paths
8990

9091
QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString& svgFilePath, double width ): mPatternWidth( width ), mOutline( 0 )
9192
{
@@ -130,7 +131,7 @@ QgsSymbolLayerV2* QgsSVGFillSymbolLayer::create( const QgsStringMap& properties
130131
}
131132
if ( properties.contains( "svgFile" ) )
132133
{
133-
svgFilePath = properties["svgFile"];
134+
svgFilePath = QgsProject::instance()->readPath( properties["svgFile"] );
134135
}
135136

136137
if ( !svgFilePath.isEmpty() )
@@ -224,7 +225,7 @@ QgsStringMap QgsSVGFillSymbolLayer::properties() const
224225
QgsStringMap map;
225226
if ( !mSvgFilePath.isEmpty() )
226227
{
227-
map.insert( "svgFile", mSvgFilePath );
228+
map.insert( "svgFile", QgsProject::instance()->writePath( mSvgFilePath ) );
228229
}
229230
else
230231
{

0 commit comments

Comments
 (0)
Please sign in to comment.