Commit ae854c6e authored by Davide Gianforte's avatar Davide Gianforte

replace deprecated QResource::isCompressed

parent 714f4831
......@@ -23,6 +23,7 @@
#include "listpanelframe.h"
#include "listpanel.h"
#include "../krglobal.h"
#include "../compat.h"
// QtCore
#include <QDebug>
......@@ -104,7 +105,7 @@ bool KrLayoutFactory::parseResource(const QString& path, QDomDocument &doc)
QResource res(path);
if (res.isValid()) {
QByteArray data;
if (res.isCompressed())
if (QRESOURCE_ISCOMPRESSED(res))
data = qUncompress(res.data(), res.size());
else
data = QByteArray(reinterpret_cast<const char*>(res.data()), res.size());
......
......@@ -28,6 +28,20 @@
#define UDS_ENTRY_INSERT(A, B) UDSEntry::insert((A), (B));
#endif
/**
* QResource::isCompressed() was made obsoleted in QT 5.15 in
* favor of QResource::Compression QResource::compressionAlgorithm()
*
* https://doc.qt.io/qt-5.15/qresource-obsolete.html#isCompressed
*
* This can be removed when the qt minimum version required will be >= 5.13
*/
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#define QRESOURCE_ISCOMPRESSED(A) (A).compressionAlgorithm() != QResource::NoCompression
#else
#define QRESOURCE_ISCOMPRESSED(A) (A).isCompressed()
#endif
/**
* QString::split(QChar sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs = Qt::CaseSensitive)
* was made obsoleted in QT 5.15 in favor of the namespaced Qt::endl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment