Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use stringToSafeFilename()
  • Loading branch information
alexbruy authored and nyalldawson committed Sep 22, 2023
1 parent a3ca16e commit 6daf48e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgsalgorithmsplitvectorlayer.h"
#include "qgsvectorfilewriter.h"
#include "qgsvariantutils.h"
#include "qgsfileutils.h"

///@cond PRIVATE

Expand Down Expand Up @@ -139,9 +140,7 @@ QVariantMap QgsSplitVectorLayerAlgorithm::processAlgorithm( const QVariantMap &p
}
else
{
QString value = ( *it ).toString();
value.replace( QRegularExpression( "<|>|\\:|\\\\|\\/|\\||\\?|\\*|\"" ), QStringLiteral( "_" ) );
fileName = QStringLiteral( "%1%2.%3" ).arg( baseName ).arg( value ).arg( outputFormat );
fileName = QStringLiteral( "%1%2.%3" ).arg( baseName ).arg( QgsFileUtils::stringToSafeFilename( ( *it ).toString() ) ).arg( outputFormat );
}
feedback->pushInfo( QObject::tr( "Creating layer: %1" ).arg( fileName ) );

Expand Down

0 comments on commit 6daf48e

Please sign in to comment.