MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / actionsList

Method actionsList

app/src/API/Handlers/ProjectHandler.cpp:3957–3979  ·  view source on GitHub ↗

* @brief List all actions */

Source from the content-addressed store, hash-verified

3955 * @brief List all actions
3956 */
3957API::CommandResponse API::Handlers::ProjectHandler::actionsList(const QString& id,
3958 const QJsonObject& params)
3959{
3960 Q_UNUSED(params)
3961
3962 const auto& actions = DataModel::ProjectModel::instance().actions();
3963
3964 QJsonArray actions_array;
3965 for (const auto& action : actions) {
3966 QJsonObject obj;
3967 obj[QStringLiteral("actionId")] = action.actionId;
3968 obj[QStringLiteral("title")] = action.title;
3969 obj[QStringLiteral("icon")] = action.icon;
3970 obj[QStringLiteral("txData")] = action.txData;
3971 actions_array.append(obj);
3972 }
3973
3974 QJsonObject result;
3975 result[QStringLiteral("actions")] = actions_array;
3976 result[QStringLiteral("actionCount")] = static_cast<int>(actions.size());
3977
3978 return CommandResponse::makeSuccess(id, result);
3979}
3980
3981/**
3982 * @brief Load project configuration from JSON object

Callers

nothing calls this directly

Calls 3

actionsMethod · 0.80
appendMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected