Commit 69fa5957 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

It's already in qt5.14

parent 717b86ab
Pipeline #48046 passed with stage
in 7 minutes and 51 seconds
......@@ -348,17 +348,9 @@ bool KTNEFParser::ParserPrivate::decodeAttachment()
default:
value = readTNEFAttribute(stream_, type, i);
qCDebug(KTNEF_LOG) << "Attachment unknown field: tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< tag << ", length="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< dec
#else
<< Qt::dec
#endif
<< i;
break;
}
......@@ -402,11 +394,7 @@ bool KTNEFParser::ParserPrivate::parseDevice()
if (i == TNEF_SIGNATURE) {
stream_ >> u;
qCDebug(KTNEF_LOG).nospace() << "Attachment cross reference key: 0x"
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< qSetFieldWidth(4) << qSetPadChar(QLatin1Char('0')) << u;
//qCDebug(KTNEF_LOG) << "stream:" << device_->pos();
while (!stream_.atEnd()) {
......@@ -631,11 +619,7 @@ QDateTime formatTime(quint32 lowB, quint32 highB)
dt = QDateTime::fromSecsSinceEpoch((unsigned int)u64);
} else {
qCWarning(KTNEF_LOG).nospace() << "Invalid date: low byte="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< showbase
#else
<< Qt::showbase
#endif
<< qSetFieldWidth(8) << qSetPadChar(QLatin1Char('0'))
<< lowB << ", high byte=" << highB;
}
......@@ -742,7 +726,7 @@ QString readMAPIString(QDataStream &stream, bool isUnicode, bool align,
quint32 fullLen = len;
if (align) {
ALIGN(fullLen, 4);
ALIGN(fullLen, 4)
}
buf = new char[ len ];
stream.readRawData(buf, len);
......@@ -847,7 +831,7 @@ quint16 readMAPIValue(QDataStream &stream, MAPI_value &mapi)
value = QByteArray(len, '\0');
if (len > 0 && len <= INT_MAX) {
uint fullLen = len;
ALIGN(fullLen, 4);
ALIGN(fullLen, 4)
stream.readRawData(value.toByteArray().data(), len);
quint8 c;
for (uint i = len; i < fullLen; i++) {
......@@ -897,11 +881,7 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
readMAPIValue(stream_, mapi);
if (mapi.type == MAPI_TYPE_NONE) {
qCDebug(KTNEF_LOG).nospace() << "MAPI unsupported: tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag << ", type=" << mapi.type;
clearMAPIValue(mapi);
return false;
......@@ -912,7 +892,7 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
if (mapi.type == MAPI_TYPE_OBJECT && attach) {
QByteArray data = mapi.value.toByteArray();
int len = data.size();
ALIGN(len, 4);
ALIGN(len, 4)
device_->seek(device_->pos() - len);
quint32 interface_ID;
stream_ >> interface_ID;
......@@ -930,7 +910,7 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
} else if (mapi.type == MAPI_TYPE_BINARY && attach && attach->offset() < 0) {
foundAttachment = true;
int len = mapi.value.toByteArray().size();
ALIGN(len, 4);
ALIGN(len, 4)
attach->setSize(len);
attach->setOffset(device_->pos() - len);
attach->addAttribute(attATTACHDATA, atpBYTE, QStringLiteral("< size=%1 >").arg(len), false);
......@@ -950,56 +930,32 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
switch (mapi.type & 0x0FFF) {
case MAPI_TYPE_UINT16:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI short" << mapiname.toLatin1().data()
<< ":"
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.value.toUInt();
break;
case MAPI_TYPE_ULONG:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI long" << mapiname.toLatin1().data()
<< ":"
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.value.toUInt();
break;
case MAPI_TYPE_BOOLEAN:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI boolean" << mapiname.toLatin1().data()
<< ":" << mapi.value.toBool();
break;
case MAPI_TYPE_TIME:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI time" << mapiname.toLatin1().data()
<< ":" << mapi.value.toString().toLatin1().data();
......@@ -1007,11 +963,7 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
case MAPI_TYPE_USTRING:
case MAPI_TYPE_STRING8:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI string" << mapiname.toLatin1().data()
<< ":size=" << mapi.value.toByteArray().size()
......@@ -1019,11 +971,7 @@ bool KTNEFParser::ParserPrivate::readMAPIProperties(QMap<int, KTNEFProperty *> &
break;
case MAPI_TYPE_BINARY:
qCDebug(KTNEF_LOG).nospace() << "(tag="
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< hex
#else
<< Qt::hex
#endif
<< mapi.tag
<< ") MAPI binary" << mapiname.toLatin1().data()
<< ":size=" << mapi.value.toByteArray().size();
......
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