mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-17 11:44:16 -04:00
Replace deprecated functions
Improve the code by replacing deprecated functions as suggested by the Qt documentation.
This commit is contained in:
committed by
Albert Astals Cid
parent
085c9c4841
commit
560d0483ae
@ -90,7 +90,7 @@ bool ANIHandler::read(QImage *outImage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QByteArray frameSizeData = device()->read(sizeof(quint32_le));
|
const QByteArray frameSizeData = device()->read(sizeof(quint32_le));
|
||||||
if (frameSizeData.count() != sizeof(quint32_le)) {
|
if (frameSizeData.size() != sizeof(quint32_le)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ bool ANIHandler::ensureScanned() const
|
|||||||
// TODO should we check that the number of rate entries matches nSteps?
|
// TODO should we check that the number of rate entries matches nSteps?
|
||||||
auto *dataPtr = data.data();
|
auto *dataPtr = data.data();
|
||||||
QVector<int> list;
|
QVector<int> list;
|
||||||
for (int i = 0; i < data.count(); i += sizeof(quint32_le)) {
|
for (int i = 0; i < data.size(); i += sizeof(quint32_le)) {
|
||||||
const auto entry = *(reinterpret_cast<const quint32_le *>(dataPtr + i));
|
const auto entry = *(reinterpret_cast<const quint32_le *>(dataPtr + i));
|
||||||
list.append(entry);
|
list.append(entry);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <QTimeZone>
|
||||||
|
|
||||||
#if defined(Q_OS_WINDOWS) && !defined(NOMINMAX)
|
#if defined(Q_OS_WINDOWS) && !defined(NOMINMAX)
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
@ -222,7 +223,7 @@ QString createTag(char *asciiz, const char *tag)
|
|||||||
|
|
||||||
QString createTimeTag(time_t time, const char *tag)
|
QString createTimeTag(time_t time, const char *tag)
|
||||||
{
|
{
|
||||||
auto value = QDateTime::fromSecsSinceEpoch(time, Qt::UTC);
|
auto value = QDateTime::fromSecsSinceEpoch(time, QTimeZone::utc());
|
||||||
if (value.isValid() && time > 0) {
|
if (value.isValid() && time > 0) {
|
||||||
return createTag(value.toString(Qt::ISODate), tag);
|
return createTag(value.toString(Qt::ISODate), tag);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user