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

Method templateList

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

* @brief Returns the templates manifest. */

Source from the content-addressed store, hash-verified

5586 * @brief Returns the templates manifest.
5587 */
5588API::CommandResponse API::Handlers::ProjectHandler::templateList(const QString& id,
5589 const QJsonObject& params)
5590{
5591 Q_UNUSED(params)
5592
5593 const auto manifest = loadTemplateManifest();
5594 if (manifest.isNull())
5595 return CommandResponse::makeError(
5596 id, ErrorCode::ExecutionError, QStringLiteral("Failed to load templates manifest"));
5597
5598 QJsonObject result;
5599 result[QStringLiteral("templates")] = manifest.object().value(QStringLiteral("templates"));
5600 return CommandResponse::makeSuccess(id, result);
5601}
5602
5603/**
5604 * @brief Loads a template into the project model.

Callers

nothing calls this directly

Calls 2

loadTemplateManifestFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected