From 3abded31869c40374315a2403f586aad7d07dae4 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 4 Oct 2016 15:45:17 +1000 Subject: [PATCH] Keep the user set order for svg paths --- src/core/qgsapplication.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 30b5415986d..99c1465e2aa 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -714,8 +714,20 @@ QStringList QgsApplication::svgPaths() myPathList = myPaths.split( '|' ); } - myPathList << ABISYM( mDefaultSvgPaths ); - return myPathList.toSet().toList(); + // maintain user set order while stripping duplicates + QStringList paths; + Q_FOREACH ( const QString& path, myPathList ) + { + if ( !paths.contains( path ) ) + paths.append( path ); + } + Q_FOREACH ( const QString& path, ABISYM( mDefaultSvgPaths ) ) + { + if ( !paths.contains( path ) ) + paths.append( path ); + } + + return paths; } /*!