29 #include <QStandardPaths>
33 : mDir( new QTemporaryDir() )
38 : mFiles( other.mFiles )
39 , mDir( new QTemporaryDir() )
47 mFiles = other.mFiles;
48 mDir.reset(
new QTemporaryDir() );
61 mDir.reset(
new QTemporaryDir() );
67 const QString tempPath = QStandardPaths::standardLocations( QStandardPaths::TempLocation ).at( 0 );
68 const QString uuid = QUuid::createUuid().toString();
69 QFile tmpFile( tempPath + QDir::separator() + uuid );
74 const QString err = QObject::tr(
"Unable to zip content" );
80 if ( QFile::exists( filename ) )
81 QFile::remove( filename );
86 dwAttrs = GetFileAttributes( tmpFile.fileName().toLocal8Bit( ).data( ) );
87 SetFileAttributes( tmpFile.fileName().toLocal8Bit( ).data( ), dwAttrs & ~ FILE_ATTRIBUTE_TEMPORARY );
91 if ( ! tmpFile.rename( filename ) )
93 const QString err = QObject::tr(
"Unable to save zip file '%1'" ).arg( filename );
109 mFiles.append( file );
116 if ( !file.isEmpty() && mFiles.contains( file ) && QFile::exists( file ) )
117 rc = QFile::remove( file );
119 mFiles.removeOne( file );
131 return QFileInfo::exists( mDir->path() );
136 const auto constFiles =
files();
137 for (
const QString &file : constFiles )
139 const QFileInfo fileInfo( file );
140 if ( fileInfo.suffix().compare( QLatin1String(
"qgs" ), Qt::CaseInsensitive ) == 0 )
164 const QStringList fileList =
files();
165 for (
const QString &file : fileList )
167 const QFileInfo fileInfo( file );
168 if ( fileInfo.suffix().compare( extension, Qt::CaseInsensitive ) == 0 )