From ec170328e2ffecde4d9268c6832d8b34ef033b45 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 24 Mar 2018 07:31:46 +0200 Subject: [PATCH] QFileInfo::created is deprecated in Qt 5.10. --HG-- branch : develop --- src/app/valentina/core/vapplication.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index cc78802b1..f2b814315 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -517,7 +517,12 @@ void VApplication::ClearOldLogs() const { auto fn = allFiles.at(i); QFileInfo info(fn); - if (info.created().daysTo(QDateTime::currentDateTime()) >= DAYS_TO_KEEP_LOGS) +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + const QDateTime created = info.birthTime(); +#else + const QDateTime created = info.created(); +#endif + if (created.daysTo(QDateTime::currentDateTime()) >= DAYS_TO_KEEP_LOGS) { VLockGuard tmp(info.absoluteFilePath(), [&fn](){return new QFile(fn);}); if (tmp.GetProtected() != nullptr)