File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 22
22
#include " qgsauxiliarystorage.h"
23
23
#include < iostream>
24
24
25
+ #include < QStandardPaths>
26
+ #include < QUuid>
27
+
25
28
QgsArchive::QgsArchive ()
26
29
: mDir( new QTemporaryDir() )
27
30
{
@@ -54,10 +57,9 @@ void QgsArchive::clear()
54
57
55
58
bool QgsArchive::zip ( const QString &filename )
56
59
{
57
- // create a temporary path
58
- QTemporaryFile tmpFile;
59
- tmpFile.open ();
60
- tmpFile.close ();
60
+ QString tempPath = QStandardPaths::standardLocations ( QStandardPaths::TempLocation ).at ( 0 );
61
+ QString uuid = QUuid::createUuid ().toString ();
62
+ QFile tmpFile ( tempPath + QDir::separator () + uuid );
61
63
62
64
// zip content
63
65
if ( ! QgsZipUtils::zip ( tmpFile.fileName (), mFiles ) )
@@ -79,9 +81,6 @@ bool QgsArchive::zip( const QString &filename )
79
81
return false ;
80
82
}
81
83
82
- // keep the zip filename
83
- tmpFile.setAutoRemove ( false );
84
-
85
84
return true ;
86
85
}
87
86
You can’t perform that action at this time.
0 commit comments