mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +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:
parent
8a9cb73686
commit
357ac89330
198 changed files with 5889 additions and 1761 deletions
|
@ -686,21 +686,30 @@ MetaTypeInfo getType(ref const string name, const ref Node node, const ref Node
|
|||
info.needsLocalImport = true;
|
||||
info.typeName = type;
|
||||
if (type in allSchemas) {
|
||||
if ("type" in allSchemas[type]
|
||||
&& allSchemas[type]["type"].as!string == "object") {
|
||||
if ("enum" in allSchemas[type]) {
|
||||
info.isTypeNullable = true;
|
||||
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
|
||||
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
|
||||
} else if ("type" in allSchemas[type]
|
||||
&& allSchemas[type]["type"].as!string == "object") {
|
||||
writefln("Type %s is an object", type);
|
||||
info.needsPointer = true;
|
||||
info.isTypeNullable = true;
|
||||
info.typeNullableCheck = ".isNull()";
|
||||
info.typeNullableSetter = ".clear()";
|
||||
} else if ("enum" in allSchemas[type]) {
|
||||
info.isTypeNullable = true;
|
||||
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
|
||||
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
// Type is an enumeration
|
||||
if ("enum" in node) {
|
||||
info.isTypeNullable = true;
|
||||
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
|
||||
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
|
||||
return info;
|
||||
}
|
||||
|
||||
// No type information specified. As a fallback, use a QVariant.
|
||||
if (!("type" in node)) {
|
||||
info.typeName = "QVariant";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue