122 QJsonObject t_jsonObjectCommand;
125 if(p_jsonDocument.isObject() && p_jsonDocument.object().value(QString(
"commands")) != QJsonValue::Undefined)
126 t_jsonObjectCommand = p_jsonDocument.object().value(QString(
"commands")).toObject();
130 QJsonObject::Iterator it;
131 for(it = t_jsonObjectCommand.begin(); it != t_jsonObjectCommand.end(); ++it)
133 if(!m_qMapCommands.contains(it.key()))
134 m_qMapCommands.insert(it.key(),
Command(it.key(), it.value().toObject(),
true,
this));
136 qWarning(
"Warning: CommandMap contains command %s already. Insertion skipped.\n", it.key().toUtf8().constData());
171 QString t_sCommandName = t_rawCommand.
command();
177 if(t_rawCommand.
count() >= m_qMapCommands[t_sCommandName].count())
179 m_qMapCommands[t_sCommandName].isJson() = t_rawCommand.
isJson();
182 for(quint32 i = 0; i < m_qMapCommands[t_sCommandName].count(); ++i)
184 QMetaType t_metaType = m_qMapCommands[t_sCommandName][i].metaType();
186 QVariant t_qVariantParam(t_rawCommand.
pValues()[i]);
188 if(t_qVariantParam.canConvert(t_metaType) && t_qVariantParam.convert(t_metaType))
189 m_qMapCommands[t_sCommandName][i] = t_qVariantParam;
194 m_qMapCommands[t_sCommandName].execute();