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

Method installExtension

app/src/API/Handlers/ExtensionHandler.cpp:218–233  ·  view source on GitHub ↗

* @brief Installs an extension by setting the selected index and triggering install. */

Source from the content-addressed store, hash-verified

216 * @brief Installs an extension by setting the selected index and triggering install.
217 */
218API::CommandResponse API::Handlers::ExtensionHandler::installExtension(const QString& id,
219 const QJsonObject& params)
220{
221 const int index = params.value("addonIndex").toInt(-1);
222 if (index < 0)
223 return CommandResponse::makeError(
224 id, QStringLiteral("INVALID_PARAMS"), "Missing or invalid addonIndex");
225
226 auto& mgr = Misc::ExtensionManager::instance();
227 mgr.setSelectedIndex(index);
228 mgr.installExtension();
229 return CommandResponse::makeSuccess(id,
230 QJsonObject{
231 {"status", "installing"}
232 });
233}
234
235/**
236 * @brief Uninstalls an extension by selecting it and triggering an irreversible directory

Callers

nothing calls this directly

Calls 2

valueMethod · 0.45
setSelectedIndexMethod · 0.45

Tested by

no test coverage detected