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

Method customizeSet

app/src/API/Handlers/WorkspacesHandler.cpp:1042–1060  ·  view source on GitHub ↗

* @brief Flips the customizeWorkspaces flag. */

Source from the content-addressed store, hash-verified

1040 * @brief Flips the customizeWorkspaces flag.
1041 */
1042API::CommandResponse API::Handlers::WorkspacesHandler::customizeSet(const QString& id,
1043 const QJsonObject& params)
1044{
1045 if (!inProjectFileMode())
1046 return CommandResponse::makeError(
1047 id, ErrorCode::InvalidParam, QStringLiteral("Workspace mutations require ProjectFile mode"));
1048
1049 if (!params.contains(QStringLiteral("enabled")))
1050 return CommandResponse::makeError(
1051 id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: enabled"));
1052
1053 const bool enabled = params.value(QStringLiteral("enabled")).toBool();
1054 DataModel::ProjectModel::instance().setCustomizeWorkspaces(enabled);
1055
1056 QJsonObject result;
1057 result[QStringLiteral("enabled")] = enabled;
1058 result[QStringLiteral("updated")] = true;
1059 return CommandResponse::makeSuccess(id, result);
1060}
1061
1062//--------------------------------------------------------------------------------------------------
1063// Widget ref mutations

Callers

nothing calls this directly

Calls 4

inProjectFileModeFunction · 0.85
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected