mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
e1dbf65672
commit
daf3821fcc
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue