Skip to content

Commit

Permalink
Fix generation of temporary processing filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 27, 2017
1 parent 3a9a0ef commit e2e829c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/processing/qgsprocessingutils.cpp
Expand Up @@ -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 );
Expand All @@ -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;
}
Expand Down

0 comments on commit e2e829c

Please sign in to comment.