summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/quazip/quazipnewinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/quazip/quazipnewinfo.cpp')
-rw-r--r--rbutil/rbutilqt/quazip/quazipnewinfo.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/quazip/quazipnewinfo.cpp b/rbutil/rbutilqt/quazip/quazipnewinfo.cpp
index 02e01da9c5..98630e086a 100644
--- a/rbutil/rbutilqt/quazip/quazipnewinfo.cpp
+++ b/rbutil/rbutilqt/quazip/quazipnewinfo.cpp
@@ -22,16 +22,25 @@ Original ZIP package is copyrighted by Gilles Vollant and contributors,
see quazip/(un)zip.h files for details. Basically it's the zlib license.
*/
-#include <QFileInfo>
+#include <QtCore/QFileInfo>
#include "quazipnewinfo.h"
#include <string.h>
static void QuaZipNewInfo_setPermissions(QuaZipNewInfo *info,
- QFile::Permissions perm, bool isDir)
+ QFile::Permissions perm, bool isDir, bool isSymLink = false)
{
quint32 uPerm = isDir ? 0040000 : 0100000;
+
+ if ( isSymLink ) {
+#ifdef Q_OS_WIN
+ uPerm = 0200000;
+#else
+ uPerm = 0120000;
+#endif
+ }
+
if ((perm & QFile::ReadOwner) != 0)
uPerm |= 0400;
if ((perm & QFile::WriteOwner) != 0)
@@ -91,7 +100,7 @@ QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file):
dateTime = QDateTime::currentDateTime();
} else {
dateTime = lm;
- QuaZipNewInfo_setPermissions(this, info.permissions(), info.isDir());
+ QuaZipNewInfo_setPermissions(this, info.permissions(), info.isDir(), info.isSymLink());
}
}
@@ -107,12 +116,12 @@ void QuaZipNewInfo::setFilePermissions(const QString &file)
{
QFileInfo info = QFileInfo(file);
QFile::Permissions perm = info.permissions();
- QuaZipNewInfo_setPermissions(this, perm, info.isDir());
+ QuaZipNewInfo_setPermissions(this, perm, info.isDir(), info.isSymLink());
}
void QuaZipNewInfo::setPermissions(QFile::Permissions permissions)
{
- QuaZipNewInfo_setPermissions(this, permissions, name.endsWith('/'));
+ QuaZipNewInfo_setPermissions(this, permissions, name.endsWith(QLatin1String("/")));
}
void QuaZipNewInfo::setFileNTFSTimes(const QString &fileName)
@@ -125,7 +134,11 @@ void QuaZipNewInfo::setFileNTFSTimes(const QString &fileName)
}
setFileNTFSmTime(fi.lastModified());
setFileNTFSaTime(fi.lastRead());
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
+ setFileNTFScTime(fi.birthTime());
+#else
setFileNTFScTime(fi.created());
+#endif
}
static void setNTFSTime(QByteArray &extra, const QDateTime &time, int position,