Skip to content
Permalink
Browse files

Fix generation of temporary processing filenames

  • Loading branch information
nyalldawson committed Jun 27, 2017
1 parent 3a9a0ef commit e2e829cacf432b9a97140c3cb5bbde3f43485655
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/processing/qgsprocessingutils.cpp
@@ -408,7 +408,7 @@ QString QgsProcessingUtils::tempFolder()
sMutex.lock();
if ( sFolder.isEmpty() )
{
QString subPath = QUuid::createUuid().toString();
QString subPath = QUuid::createUuid().toString().remove( '-' ).remove( '{' ).remove( '}' );
sFolder = QDir::tempPath() + QStringLiteral( "/processing_" ) + subPath;
if ( !QDir( sFolder ).exists() )
QDir().mkpath( sFolder );
@@ -419,12 +419,12 @@ QString QgsProcessingUtils::tempFolder()

QString QgsProcessingUtils::generateTempFilename( const QString &basename )
{
QString subPath = QUuid::createUuid().toString();
QString subPath = QUuid::createUuid().toString().remove( '-' ).remove( '{' ).remove( '}' );
QString path = tempFolder() + '/' + subPath;
if ( !QDir( path ).exists() ) //make sure the directory exists - it shouldn't, but lets be safe...
{
QDir tmpDir( QDir::tempPath() );
tmpDir.mkdir( subPath );
QDir tmpDir;
tmpDir.mkdir( path );
}
return path + '/' + basename;
}

0 comments on commit e2e829c

Please sign in to comment.
You can’t perform that action at this time.