1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-01 08:52:45 +00:00

Fix sending of DeviceProfileInfo

Due to some errors within DeviceProfile and how nullables were
serialized, an invalid request was made and the
/Sessions/Capabilities/Full would give an 400 response back.

Besides that, ApiClient would generate a DeviceProfile before all
properties from QML were read. This has been fixed by implementing
QQmlParserStatus and only generating the device profile after all
properties are set.
This commit is contained in:
Henk Kalkwater 2021-09-08 23:20:12 +02:00
parent 8a9cb73686
commit 357ac89330
No known key found for this signature in database
GPG key ID: A69C050E9FD9FF6A
198 changed files with 5889 additions and 1761 deletions

View file

@ -45,8 +45,17 @@ QJsonObject {{className}}::toJson() const {
QJsonObject result;
{{#each properties as |property|}}
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
{{#if property.isNullable}}
if (!({{property.nullableCheck}})) {
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
}
{{#else}}
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
{{/if}}
{{/each}}
return result;