1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-06 18:32:45 +00:00

Make model code compileable

This disables some application level logic, but I'm going to rewrite
that using Lager anyway.
This commit is contained in:
Chris Josten 2021-03-20 16:29:31 +01:00
parent 0358418926
commit b9b08ab384
551 changed files with 8943 additions and 8809 deletions

View file

@ -32,22 +32,23 @@
namespace Jellyfin {
namespace DTO {
DeviceOptions::DeviceOptions(QObject *parent) {}
DeviceOptions::DeviceOptions() {}
DeviceOptions DeviceOptions::fromJson(QJsonObject source) {DeviceOptions instance;
instance->setFromJson(source, false);
DeviceOptions DeviceOptions::fromJson(QJsonObject source) {
DeviceOptions instance;
instance.setFromJson(source);
return instance;
}
void DeviceOptions::setFromJson(QJsonObject source) {
m_customName = fromJsonValue<QString>(source["CustomName"]);
m_customName = Jellyfin::Support::fromJsonValue<QString>(source["CustomName"]);
}
QJsonObject DeviceOptions::toJson() {
QJsonObject result;
result["CustomName"] = toJsonValue<QString>(m_customName);
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
return result;
}
@ -58,6 +59,17 @@ void DeviceOptions::setCustomName(QString newCustomName) {
m_customName = newCustomName;
}
} // NS DTO
namespace Support {
using DeviceOptions = Jellyfin::DTO::DeviceOptions;
template <>
DeviceOptions fromJsonValue<DeviceOptions>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceOptions::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO