mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-01 08:52:45 +00:00
WIP: HttpLoader seems to work, Model still borked
This commit is contained in:
parent
e421adf733
commit
729e343661
1412 changed files with 13967 additions and 33794 deletions
|
@ -1,6 +1,5 @@
|
|||
{{className}}Class::{{className}}Class() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
@ -9,7 +8,7 @@ using {{className}} = Jellyfin::DTO::{{className}};
|
|||
|
||||
template <>
|
||||
|
||||
{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) {
|
||||
{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>) {
|
||||
if (!source.isString()) return {{className}}::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
|
@ -23,3 +22,19 @@ template <>
|
|||
|
||||
return {{className}}::EnumNotSet;
|
||||
}
|
||||
|
||||
template <>
|
||||
QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>) {
|
||||
switch(source) {
|
||||
|
||||
{{#each values as |value|}}
|
||||
case {{className}}::{{value}}:
|
||||
return QStringLiteral("{{value}}");
|
||||
|
||||
{{/each}}
|
||||
|
||||
case {{className}}::EnumNotSet: // Fallthrough
|
||||
default:
|
||||
return QJsonValue();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue