From daf3821fcceda2407bfff0a11ed2412401d05333 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 6 Jan 2020 12:43:09 -0800 Subject: code cleanup: replace created() with birthTime() for Qt >= 5.10 We still support Qt5.9 for now, so we need the version check as birthTime() wasn't available in 5.9. Signed-off-by: Dirk Hohndel --- core/metadata.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/metadata.cpp b/core/metadata.cpp index dae261b93..8692ea30f 100644 --- a/core/metadata.cpp +++ b/core/metadata.cpp @@ -540,9 +540,12 @@ extern "C" mediatype_t get_metadata(const char *filename_in, metadata *data) // If we couldn't get a creation date from the file (for example AVI files don't // have a standard way of storing this datum), use the file creation date of the file. - // TODO: QFileInfo::created is deprecated in newer Qt versions. if (data->timestamp == 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + data->timestamp = QFileInfo(filename).birthTime().toMSecsSinceEpoch() / 1000; +#else data->timestamp = QFileInfo(filename).created().toMSecsSinceEpoch() / 1000; +#endif return res; } -- cgit v1.2.3-70-g09d2