|
@@ -70,6 +70,7 @@ |
|
|
#include "qgsmeshlayer.h" |
|
|
#include "qgsfeaturestore.h" |
|
|
#include "qgslocator.h" |
|
|
#include "qgsreadwritelocker.h" |
|
|
|
|
|
#include "gps/qgsgpsconnectionregistry.h" |
|
|
#include "processing/qgsprocessingregistry.h" |
|
@@ -1050,27 +1051,46 @@ QString QgsApplication::srsDatabaseFilePath() |
|
|
} |
|
|
} |
|
|
|
|
|
void QgsApplication::setSvgPaths( const QStringList &svgPaths ) |
|
|
{ |
|
|
QgsSettings().setValue( QStringLiteral( "svg/searchPathsForSVG" ), svgPaths ); |
|
|
members()->mSvgPathCacheValid = false; |
|
|
} |
|
|
|
|
|
QStringList QgsApplication::svgPaths() |
|
|
{ |
|
|
//local directories to search when looking for an SVG with a given basename |
|
|
//defined by user in options dialog |
|
|
QgsSettings settings; |
|
|
const QStringList pathList = settings.value( QStringLiteral( "svg/searchPathsForSVG" ) ).toStringList(); |
|
|
static QReadWriteLock lock; |
|
|
|
|
|
QgsReadWriteLocker locker( lock, QgsReadWriteLocker::Read ); |
|
|
|
|
|
// maintain user set order while stripping duplicates |
|
|
QStringList paths; |
|
|
for ( const QString &path : pathList ) |
|
|
if ( members()->mSvgPathCacheValid ) |
|
|
{ |
|
|
if ( !paths.contains( path ) ) |
|
|
paths.append( path ); |
|
|
return members()->mSvgPathCache; |
|
|
} |
|
|
for ( const QString &path : qgis::as_const( *sDefaultSvgPaths() ) ) |
|
|
else |
|
|
{ |
|
|
if ( !paths.contains( path ) ) |
|
|
paths.append( path ); |
|
|
} |
|
|
locker.changeMode( QgsReadWriteLocker::Write ); |
|
|
//local directories to search when looking for an SVG with a given basename |
|
|
//defined by user in options dialog |
|
|
QgsSettings settings; |
|
|
const QStringList pathList = settings.value( QStringLiteral( "svg/searchPathsForSVG" ) ).toStringList(); |
|
|
|
|
|
return paths; |
|
|
// maintain user set order while stripping duplicates |
|
|
QStringList paths; |
|
|
for ( const QString &path : pathList ) |
|
|
{ |
|
|
if ( !paths.contains( path ) ) |
|
|
paths.append( path ); |
|
|
} |
|
|
for ( const QString &path : qgis::as_const( *sDefaultSvgPaths() ) ) |
|
|
{ |
|
|
if ( !paths.contains( path ) ) |
|
|
paths.append( path ); |
|
|
} |
|
|
members()->mSvgPathCache = paths; |
|
|
|
|
|
return paths; |
|
|
} |
|
|
} |
|
|
|
|
|
QStringList QgsApplication::layoutTemplatePaths() |
|
|