* @brief Materialises the synthetic auto-workspaces into customized state. */
| 1003 | * @brief Materialises the synthetic auto-workspaces into customized state. |
| 1004 | */ |
| 1005 | API::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 |
nothing calls this directly
no test coverage detected