Added alternative for birthTime for older qt versions
This commit is contained in:
committed by
Daniel Brunner
parent
2a52477436
commit
562c4f429a
10
main.cpp
10
main.cpp
@@ -14,6 +14,7 @@
|
|||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
bool writeBitmap(const QString &filename, const QByteArray &content)
|
bool writeBitmap(const QString &filename, const QByteArray &content)
|
||||||
{
|
{
|
||||||
@@ -293,7 +294,14 @@ bool spread(const QString &sourcePath, const QString &targetPath)
|
|||||||
QJsonObject jsonObject;
|
QJsonObject jsonObject;
|
||||||
jsonObject["type"] = "file";
|
jsonObject["type"] = "file";
|
||||||
jsonObject["filesize"] = sourceFileInfo.size();
|
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["lastModified"] = sourceFileInfo.lastModified().toMSecsSinceEpoch();
|
||||||
jsonObject["lastRead"] = sourceFileInfo.lastRead().toMSecsSinceEpoch();
|
jsonObject["lastRead"] = sourceFileInfo.lastRead().toMSecsSinceEpoch();
|
||||||
jsonObject["sha512"] = QString(hash.result().toHex());
|
jsonObject["sha512"] = QString(hash.result().toHex());
|
||||||
|
Reference in New Issue
Block a user