QmlDesigner: Fix creation date issue on macOS

On macOS the creation date was not according to the date/time when the
example was unzipped it was rather the date/time when the example folder
was zipped. By removing the already existing folder and create it again
to hold the content of the zip archive this issue should b circumvented.

Task-number: QDS-6288
Change-Id: Icf18c4fcddcacf69feeca536f6d0e81f4c126afe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2022-02-17 21:39:54 +01:00
committed by Henning Gründl
parent 1d06032453
commit 3d56b8b54a

View File

@@ -368,12 +368,21 @@ QString FileExtractor::sourceFile() const
void FileExtractor::extract()
{
const QString targetFolder = m_targetPath.toString() + "/" + m_archiveName;
// If the target directory already exists, remove it and its content
QDir targetDir(targetFolder);
if (targetDir.exists())
targetDir.removeRecursively();
// Create a new directory to generate a proper creation date
targetDir.mkdir(targetFolder);
Utils::Archive *archive = Utils::Archive::unarchive(m_sourceFile, m_targetPath);
archive->setParent(this);
QTC_ASSERT(archive, return );
m_timer.start();
const QString targetFolder = m_targetPath.toString() + "/" + m_archiveName;
qint64 bytesBefore = QStorageInfo(m_targetPath.toFileInfo().dir()).bytesAvailable();
qint64 compressedSize = QFileInfo(m_sourceFile.toString()).size();