Fix suggestLogging property not working for eventTypes
This commit is contained in:
parent
3af830e559
commit
65736e1034
@ -533,7 +533,10 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
|
||||
index = 0;
|
||||
foreach (const QJsonValue &actionTypesJson, thingClassObject.value("actionTypes").toArray()) {
|
||||
QJsonObject at = actionTypesJson.toObject();
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(ActionType::typeProperties(), ActionType::mandatoryTypeProperties(), at);
|
||||
|
||||
QStringList actionTypeProperties = {"id", "name", "displayName", "paramTypes"};
|
||||
QStringList mandatoryActionTypeProperties = {"id", "name", "displayName"};
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(actionTypeProperties, mandatoryActionTypeProperties, at);
|
||||
|
||||
// Check mandatory fields
|
||||
if (!verificationResult.first.isEmpty()) {
|
||||
@ -580,7 +583,10 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
|
||||
foreach (const QJsonValue &eventTypesJson, thingClassObject.value("eventTypes").toArray()) {
|
||||
QJsonObject et = eventTypesJson.toObject();
|
||||
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(EventType::typeProperties(), EventType::mandatoryTypeProperties(), et);
|
||||
QStringList eventTypeProperties = {"id", "name", "displayName", "paramTypes", "suggestLogging"};
|
||||
QStringList mandatoryEventTypeProperties = {"id", "name", "displayName"};
|
||||
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(eventTypeProperties, mandatoryEventTypeProperties, et);
|
||||
|
||||
// Check mandatory fields
|
||||
if (!verificationResult.first.isEmpty()) {
|
||||
@ -625,7 +631,9 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
|
||||
index = 0;
|
||||
foreach (const QJsonValue &browserItemActionTypesJson, thingClassObject.value("browserItemActionTypes").toArray()) {
|
||||
QJsonObject at = browserItemActionTypesJson.toObject();
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(ActionType::typeProperties(), ActionType::mandatoryTypeProperties(), at);
|
||||
QStringList actionTypeProperties = {"id", "name", "displayName", "paramTypes"};
|
||||
QStringList mandatoryActionTypeProperties = {"id", "name", "displayName"};
|
||||
QPair<QStringList, QStringList> verificationResult = verifyFields(actionTypeProperties, mandatoryActionTypeProperties, at);
|
||||
|
||||
// Check mandatory fields
|
||||
if (!verificationResult.first.isEmpty()) {
|
||||
|
||||
@ -111,18 +111,6 @@ void ActionType::setParamTypes(const ParamTypes ¶mTypes)
|
||||
m_paramTypes = paramTypes;
|
||||
}
|
||||
|
||||
/*! Returns a list of all valid properties a ActionType definition can have. */
|
||||
QStringList ActionType::typeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName" << "paramTypes";
|
||||
}
|
||||
|
||||
/*! Returns a list of mandatory properties a ActionType definition must have. */
|
||||
QStringList ActionType::mandatoryTypeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName";
|
||||
}
|
||||
|
||||
ActionTypes::ActionTypes(const QList<ActionType> &other)
|
||||
{
|
||||
foreach (const ActionType &at, other) {
|
||||
|
||||
@ -63,9 +63,6 @@ public:
|
||||
ParamTypes paramTypes() const;
|
||||
void setParamTypes(const ParamTypes ¶mTypes);
|
||||
|
||||
static QStringList typeProperties();
|
||||
static QStringList mandatoryTypeProperties();
|
||||
|
||||
private:
|
||||
ActionTypeId m_id;
|
||||
QString m_name;
|
||||
|
||||
@ -126,18 +126,6 @@ bool EventType::isValid() const
|
||||
return !m_id.isNull() && !m_name.isEmpty();
|
||||
}
|
||||
|
||||
/*! Returns a list of all valid JSON properties a EventType JSON definition can have. */
|
||||
QStringList EventType::typeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName" << "paramTypes";
|
||||
}
|
||||
|
||||
/*! Returns a list of mandatory JSON properties a EventType JSON definition must have. */
|
||||
QStringList EventType::mandatoryTypeProperties()
|
||||
{
|
||||
return QStringList() << "id" << "name" << "displayName";
|
||||
}
|
||||
|
||||
EventTypes::EventTypes(const QList<EventType> &other)
|
||||
{
|
||||
foreach (const EventType &et, other) {
|
||||
|
||||
@ -69,9 +69,6 @@ public:
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
static QStringList typeProperties();
|
||||
static QStringList mandatoryTypeProperties();
|
||||
|
||||
private:
|
||||
EventTypeId m_id;
|
||||
QString m_name;
|
||||
|
||||
Reference in New Issue
Block a user