Skip to content

Commit 538b7c9

Browse files
committedJan 18, 2017
prevent duplication of SVG path (fix #16056)
(partially cherry-picked from c60c4f7)
1 parent f4d9514 commit 538b7c9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed
 

‎src/core/qgsapplication.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,20 @@ QStringList QgsApplication::svgPaths()
702702
myPathList = myPaths.split( '|' );
703703
}
704704

705-
myPathList << ABISYM( mDefaultSvgPaths );
706-
return myPathList;
705+
// maintain user set order while stripping duplicates
706+
QStringList paths;
707+
Q_FOREACH ( const QString& path, myPathList )
708+
{
709+
if ( !paths.contains( path ) )
710+
paths.append( path );
711+
}
712+
Q_FOREACH ( const QString& path, ABISYM( mDefaultSvgPaths ) )
713+
{
714+
if ( !paths.contains( path ) )
715+
paths.append( path );
716+
}
717+
718+
return paths;
707719
}
708720

709721
/*!

0 commit comments

Comments
 (0)
Please sign in to comment.