Skip to content

Commit 40f683d

Browse files
committed
Trying to fix mac test for QgsProject
1 parent a4717e2 commit 40f683d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/core/symbology-ng/qgssymbollayerutils.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -3640,6 +3640,9 @@ QString QgsSymbolLayerUtils::svgSymbolPathToName( QString path, const QgsPathRes
36403640
if ( !QFileInfo::exists( path ) )
36413641
return path;
36423642

3643+
// keep original path for path resolver as its path does not have to be cannonical either
3644+
QString origPath = path;
3645+
36433646
path = QFileInfo( path ).canonicalFilePath();
36443647

36453648
QStringList svgPaths = QgsApplication::svgPaths();
@@ -3660,7 +3663,7 @@ QString QgsSymbolLayerUtils::svgSymbolPathToName( QString path, const QgsPathRes
36603663
if ( isInSvgPaths )
36613664
return path;
36623665

3663-
return pathResolver.writePath( path );
3666+
return pathResolver.writePath( origPath );
36643667
}
36653668

36663669

tests/src/core/testqgsproject.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ void TestQgsProject::testPathResolverSvg()
196196
svgFile.write( "<svg/>" ); // not a proper SVG, but good enough for this case
197197
svgFile.close();
198198

199+
QVERIFY( QFileInfo::exists( ourSvgPath ) ); // should exist now
200+
199201
QString librarySvgPath = QgsSymbolLayerUtils::svgSymbolNameToPath( "transport/transport_airport.svg", QgsPathResolver() );
200202

201203
QgsVectorLayer *layer1 = new QgsVectorLayer( layerPath, "points 1", "ogr" );

0 commit comments

Comments
 (0)