From 269484835651af27f48a805b3e138d9c390d2254 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Mon, 9 Sep 2024 18:37:50 +0700 Subject: [PATCH] [processing] Fix points to path algorithm's handling of text folder output's temporary destination --- src/analysis/processing/qgsalgorithmpointstopaths.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/analysis/processing/qgsalgorithmpointstopaths.cpp b/src/analysis/processing/qgsalgorithmpointstopaths.cpp index 2b2d5e284794..3c2b91dcdac4 100644 --- a/src/analysis/processing/qgsalgorithmpointstopaths.cpp +++ b/src/analysis/processing/qgsalgorithmpointstopaths.cpp @@ -210,9 +210,10 @@ QVariantMap QgsPointsToPathsAlgorithm::processAlgorithm( const QVariantMap ¶ throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) ); const QString textDir = parameterAsString( parameters, QStringLiteral( "OUTPUT_TEXT_DIR" ), context ); - if ( ! textDir.isEmpty() && - ! QDir( textDir ).exists() ) - throw QgsProcessingException( QObject::tr( "The text output directory does not exist" ) ); + if ( !textDir.isEmpty() && !QDir().mkpath( textDir ) ) + { + throw QgsProcessingException( QObject::tr( "Failed to create the text output directory" ) ); + } QgsDistanceArea da = QgsDistanceArea(); da.setSourceCrs( source->sourceCrs(), context.transformContext() );