Commit 19dba9a6 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Support pure time properties

Useful for e.g. checkinTime. It can technically be a date time but in practice it has to be seen if it actually is used as more than a time.

Differential Revision: https://phabricator.kde.org/D27713
parent afb22986
...@@ -108,6 +108,8 @@ static QVariant propertyValue(const QMetaProperty &prop, const QJsonValue &v) ...@@ -108,6 +108,8 @@ static QVariant propertyValue(const QMetaProperty &prop, const QJsonValue &v)
return v.toDouble(); return v.toDouble();
} }
return v.toString().toInt(); return v.toString().toInt();
case QVariant::Time:
return QTime::fromString(v.toString(), Qt::ISODate);
case QVariant::Url: case QVariant::Url:
return QUrl(v.toString()); return QUrl(v.toString());
default: default:
...@@ -305,6 +307,8 @@ static QJsonValue toJsonValue(const QVariant &v) ...@@ -305,6 +307,8 @@ static QJsonValue toJsonValue(const QVariant &v)
} }
return v.toDateTime().toString(Qt::ISODate); return v.toDateTime().toString(Qt::ISODate);
} }
case QVariant::Time:
return v.toTime().toString(Qt::ISODate);
case QVariant::Url: case QVariant::Url:
return v.toUrl().toString(); return v.toUrl().toString();
case QVariant::Bool: case QVariant::Bool:
......
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