Merge PR #435: Add support for QList<QDateTime> -> [time_t] conversion to JSON
This commit is contained in:
commit
c1d1348c4d
@ -359,6 +359,10 @@ QVariant JsonHandler::pack(const QMetaObject &metaObject, const void *value) con
|
|||||||
foreach (const EventTypeId &entry, propertyValue.value<QList<EventTypeId>>()) {
|
foreach (const EventTypeId &entry, propertyValue.value<QList<EventTypeId>>()) {
|
||||||
list << entry;
|
list << entry;
|
||||||
}
|
}
|
||||||
|
} else if (propertyTypeName == "QList<QDateTime>") {
|
||||||
|
foreach (const QDateTime ×tamp, propertyValue.value<QList<QDateTime>>()) {
|
||||||
|
list << timestamp.toMSecsSinceEpoch() / 1000;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT_X(false, this->metaObject()->className(), QString("Unhandled list type: %1").arg(propertyTypeName).toUtf8());
|
Q_ASSERT_X(false, this->metaObject()->className(), QString("Unhandled list type: %1").arg(propertyTypeName).toUtf8());
|
||||||
qCWarning(dcJsonRpc()) << "Cannot pack property of unhandled list type" << propertyTypeName;
|
qCWarning(dcJsonRpc()) << "Cannot pack property of unhandled list type" << propertyTypeName;
|
||||||
|
|||||||
Reference in New Issue
Block a user