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

Method autoGenerate

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

* @brief Materialises the synthetic auto-workspaces into customized state. */

Source from the content-addressed store, hash-verified

1003 * @brief Materialises the synthetic auto-workspaces into customized state.
1004 */
1005API::CommandResponse API::Handlers::WorkspacesHandler::autoGenerate(const QString& id,
1006 const QJsonObject& params)
1007{
1008 Q_UNUSED(params)
1009
1010 if (!inProjectFileMode())
1011 return CommandResponse::makeError(
1012 id, ErrorCode::InvalidParam, QStringLiteral("Workspace mutations require ProjectFile mode"));
1013
1014 const int firstId = DataModel::ProjectModel::instance().autoGenerateWorkspaces();
1015
1016 QJsonObject result;
1017 result[QStringLiteral("firstWorkspaceId")] = firstId;
1018 result[QStringLiteral("generated")] = (firstId != -1);
1019 return CommandResponse::makeSuccess(id, result);
1020}
1021
1022//--------------------------------------------------------------------------------------------------
1023// Customize flag

Callers

nothing calls this directly

Calls 2

inProjectFileModeFunction · 0.85

Tested by

no test coverage detected