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

Method activate

app/src/API/Handlers/LicensingHandler.cpp:199–216  ·  view source on GitHub ↗

* @brief Activate the stored license key against the LemonSqueezy server. */

Source from the content-addressed store, hash-verified

197 * @brief Activate the stored license key against the LemonSqueezy server.
198 */
199API::CommandResponse API::Handlers::LicensingHandler::activate(const QString& id,
200 const QJsonObject&)
201{
202 auto& ls = Licensing::LemonSqueezy::instance();
203
204 if (!ls.canActivate()) {
205 return CommandResponse::makeError(
206 id, ErrorCode::InvalidParam, QStringLiteral("No valid license key set (must be 36 chars)"));
207 }
208
209 if (ls.busy()) {
210 return CommandResponse::makeError(
211 id, ErrorCode::ExecutionError, QStringLiteral("Licensing operation already in progress"));
212 }
213
214 ls.activate();
215 return CommandResponse::makeSuccess(id, {});
216}
217
218/**
219 * @brief Deactivate the current license on this machine, freeing a seat.

Callers

nothing calls this directly

Calls 2

canActivateMethod · 0.80
busyMethod · 0.45

Tested by

no test coverage detected