Skip to content
Permalink
Browse files
use QgsFileUtils::ensureFileNameHasExtension
  • Loading branch information
vcloarec authored and github-actions committed Nov 14, 2021
1 parent 8d32b78 commit 3b4837c473e5dbe970d1b107816ce0869f8dfc82
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/analysis/processing/qgsalgorithmtinmeshcreation.cpp
@@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsalgorithmtinmeshcreation.h"
#include "qgsfileutils.h"
#include "qgsprovidermetadata.h"
#include "qgsproviderregistry.h"
#include "qgsprocessingparametertininputlayers.h"
@@ -176,11 +177,13 @@ QVariantMap QgsTinMeshCreationAlgorithm::processAlgorithm( const QVariantMap &pa

const QgsProviderMetadata *providerMetadata = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "mdal" ) );

QFileInfo fileInfo( fileName );
QString suffix = fileInfo.suffix();
// QFileInfo fileInfo( fileName );
// QString suffix = fileInfo.suffix();

if ( suffix.isEmpty() )
fileName.append( QStringLiteral( ".%1" ).arg( mDriverSuffix.value( driver ) ) );
// if ( suffix.isEmpty() )
// fileName.append( QStringLiteral( ".%1" ).arg( mDriverSuffix.value( driver ) ) );

fileName = QgsFileUtils::ensureFileNameHasExtension( fileName, QStringList() << mDriverSuffix.value( driver ) );

if ( feedback )
feedback->setProgressText( QObject::tr( "Saving mesh to file" ) );

0 comments on commit 3b4837c

Please sign in to comment.