Skip to content

Commit

Permalink
Trying to fix mac test for QgsProject
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 13, 2017
1 parent a4717e2 commit 40f683d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/symbology-ng/qgssymbollayerutils.cpp
Expand Up @@ -3640,6 +3640,9 @@ QString QgsSymbolLayerUtils::svgSymbolPathToName( QString path, const QgsPathRes
if ( !QFileInfo::exists( path ) )
return path;

// keep original path for path resolver as its path does not have to be cannonical either
QString origPath = path;

path = QFileInfo( path ).canonicalFilePath();

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

return pathResolver.writePath( path );
return pathResolver.writePath( origPath );
}


Expand Down
2 changes: 2 additions & 0 deletions tests/src/core/testqgsproject.cpp
Expand Up @@ -196,6 +196,8 @@ void TestQgsProject::testPathResolverSvg()
svgFile.write( "<svg/>" ); // not a proper SVG, but good enough for this case
svgFile.close();

QVERIFY( QFileInfo::exists( ourSvgPath ) ); // should exist now

QString librarySvgPath = QgsSymbolLayerUtils::svgSymbolNameToPath( "transport/transport_airport.svg", QgsPathResolver() );

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

0 comments on commit 40f683d

Please sign in to comment.