Showing the changes to libraries/script-engine/src/MenuItemProperties.cpp (1 of 5 files). Show all
Unified · Split
| @@ -78,6 +78,12 @@ ScriptValue menuItemPropertiesToScriptValue(ScriptEngine* engine, const MenuItem · 77 unmodified lines | |||
| 78 | * @property {string} [grouping] - The name of grouping to add this menu item to. | 78 | * @property {string} [grouping] - The name of grouping to add this menu item to. |
| 79 | */ | 79 | */ |
| 80 | bool menuItemPropertiesFromScriptValue(const ScriptValue& object, MenuItemProperties& properties) { | 80 | bool menuItemPropertiesFromScriptValue(const ScriptValue& object, MenuItemProperties& properties) { |
| 81 | if (!object.hasProperty("menuName")) { | ||
| 82 | return false; | ||
| 83 | } | ||
| 84 | if (!object.hasProperty("menuItemName")) { | ||
| 85 | return false; | ||
| 86 | } | ||
| 81 | properties.menuName = object.property("menuName").toVariant().toString(); | 87 | properties.menuName = object.property("menuName").toVariant().toString(); |
| 82 | properties.menuItemName = object.property("menuItemName").toVariant().toString(); | 88 | properties.menuItemName = object.property("menuItemName").toVariant().toString(); |
| 83 | properties.isCheckable = object.property("isCheckable").toVariant().toBool(); | 89 | properties.isCheckable = object.property("isCheckable").toVariant().toBool(); |