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

Method deactivate

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

* @brief Deactivate the current license on this machine, freeing a seat. */

Source from the content-addressed store, hash-verified

219 * @brief Deactivate the current license on this machine, freeing a seat.
220 */
221API::CommandResponse API::Handlers::LicensingHandler::deactivate(const QString& id,
222 const QJsonObject&)
223{
224 auto& ls = Licensing::LemonSqueezy::instance();
225
226 if (!ls.isActivated()) {
227 return CommandResponse::makeError(
228 id, ErrorCode::ExecutionError, QStringLiteral("No active license to deactivate"));
229 }
230
231 if (ls.busy()) {
232 return CommandResponse::makeError(
233 id, ErrorCode::ExecutionError, QStringLiteral("Licensing operation already in progress"));
234 }
235
236 ls.deactivate();
237 return CommandResponse::makeSuccess(id, {});
238}
239
240/**
241 * @brief Re-validate the active license against the LemonSqueezy server.

Callers

nothing calls this directly

Calls 2

isActivatedMethod · 0.45
busyMethod · 0.45

Tested by

no test coverage detected