From 562c4f429a463d7b7c898e291165a769b80f50f9 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Tue, 18 Sep 2018 22:07:27 +0200 Subject: [PATCH] Added alternative for birthTime for older qt versions --- main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index f39c801..b90a473 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,7 @@ #include #include #include +#include bool writeBitmap(const QString &filename, const QByteArray &content) { @@ -293,7 +294,14 @@ bool spread(const QString &sourcePath, const QString &targetPath) QJsonObject jsonObject; jsonObject["type"] = "file"; jsonObject["filesize"] = sourceFileInfo.size(); - jsonObject["birthTime"] = sourceFileInfo.birthTime().toMSecsSinceEpoch(); + + jsonObject["birthTime"] = sourceFileInfo +#if QT_VERSION >= 0x051000 + .birthTime() +#else + .created() +#endif + .toMSecsSinceEpoch(); jsonObject["lastModified"] = sourceFileInfo.lastModified().toMSecsSinceEpoch(); jsonObject["lastRead"] = sourceFileInfo.lastRead().toMSecsSinceEpoch(); jsonObject["sha512"] = QString(hash.result().toHex());