* @brief Set the working directory for Launch mode. */
| 167 | * @brief Set the working directory for Launch mode. |
| 168 | */ |
| 169 | API::CommandResponse API::Handlers::ProcessHandler::setWorkingDir(const QString& id, |
| 170 | const QJsonObject& params) |
| 171 | { |
| 172 | if (!params.contains(QStringLiteral("workingDir"))) { |
| 173 | return CommandResponse::makeError( |
| 174 | id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: workingDir")); |
| 175 | } |
| 176 | |
| 177 | const QString dir = params.value(QStringLiteral("workingDir")).toString(); |
| 178 | IO::ConnectionManager::instance().process()->setWorkingDir(dir); |
| 179 | |
| 180 | QJsonObject result; |
| 181 | result[QStringLiteral("workingDir")] = dir; |
| 182 | return CommandResponse::makeSuccess(id, result); |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * @brief Set the named pipe / FIFO path for NamedPipe mode. |