Make JavaScript processing code compatible with Qt 5
This commit is contained in:
parent
11d3cefbcf
commit
8c2ab29927
|
@ -26,6 +26,16 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
uint qHash(const TagParser::KnownField key, uint seed) noexcept
|
||||||
|
{
|
||||||
|
return ::qHash(static_cast<std::underlying_type_t<TagParser::KnownField>>(key), seed);
|
||||||
|
}
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Cli {
|
namespace Cli {
|
||||||
|
|
||||||
|
@ -95,9 +105,16 @@ QString UtilityObject::fixUmlauts(const QString &str) const
|
||||||
|
|
||||||
TagValueObject::TagValueObject(const TagParser::TagValue &value, QJSEngine *engine, QObject *parent)
|
TagValueObject::TagValueObject(const TagParser::TagValue &value, QJSEngine *engine, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
, m_type(QString::fromUtf8(TagParser::tagDataTypeString(value.type())))
|
, m_type(QString::fromUtf8(TagParser::tagDataTypeString(value.type())))
|
||||||
|
#endif
|
||||||
, m_initial(true)
|
, m_initial(true)
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const auto type = TagParser::tagDataTypeString(value.type());
|
||||||
|
m_type = QString::fromUtf8(type.data(), type.size());
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (value.type()) {
|
switch (value.type()) {
|
||||||
case TagParser::TagDataType::Undefined:
|
case TagParser::TagDataType::Undefined:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
#ifndef CLI_MEDIA_FILE_INFO_OBJECT_H
|
#ifndef CLI_MEDIA_FILE_INFO_OBJECT_H
|
||||||
#define CLI_MEDIA_FILE_INFO_OBJECT_H
|
#define CLI_MEDIA_FILE_INFO_OBJECT_H
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace TagParser {
|
||||||
|
enum class KnownField : unsigned int;
|
||||||
|
}
|
||||||
|
uint qHash(const TagParser::KnownField key, uint seed = 0) noexcept;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QJSValue>
|
#include <QJSValue>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue