Cleanup pre-Qt 6.5 code

This commit is contained in:
Volker Krause 2023-11-19 14:14:36 +01:00
parent 7864ad4bc6
commit 91a342e90d
2 changed files with 1 additions and 8 deletions

View File

@ -81,7 +81,7 @@ set_package_properties(LibRaw PROPERTIES
) )
ecm_set_disabled_deprecation_versions( ecm_set_disabled_deprecation_versions(
QT 6.4 QT 6.5
KF 5.102 KF 5.102
) )

View File

@ -90,10 +90,7 @@
#include <QImageIOPlugin> #include <QImageIOPlugin>
#include <QLocale> #include <QLocale>
#include <QThread> #include <QThread>
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
#include <QTimeZone> #include <QTimeZone>
#endif
// Allow the code to works on all QT versions supported by KDE // Allow the code to works on all QT versions supported by KDE
// project (Qt 5.15 and Qt 6.x) to easy backports fixes. // project (Qt 5.15 and Qt 6.x) to easy backports fixes.
@ -319,11 +316,7 @@ static void readMetadata(const Imf::Header &header, QImage &image)
} }
auto dateTime = QDateTime::fromString(QString::fromStdString(capDate->value()), QStringLiteral("yyyy:MM:dd HH:mm:ss")); auto dateTime = QDateTime::fromString(QString::fromStdString(capDate->value()), QStringLiteral("yyyy:MM:dd HH:mm:ss"));
if (dateTime.isValid()) { if (dateTime.isValid()) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
dateTime.setTimeZone(QTimeZone::fromSecondsAheadOfUtc(off)); dateTime.setTimeZone(QTimeZone::fromSecondsAheadOfUtc(off));
#else
dateTime.setOffsetFromUtc(off);
#endif
image.setText(QStringLiteral("CreationDate"), dateTime.toString(Qt::ISODate)); image.setText(QStringLiteral("CreationDate"), dateTime.toString(Qt::ISODate));
} }
} }