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

Method setWorkingDir

app/src/API/Handlers/ProcessHandler.cpp:169–183  ·  view source on GitHub ↗

* @brief Set the working directory for Launch mode. */

Source from the content-addressed store, hash-verified

167 * @brief Set the working directory for Launch mode.
168 */
169API::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.

Callers

nothing calls this directly

Calls 3

containsMethod · 0.45
valueMethod · 0.45
processMethod · 0.45

Tested by

no test coverage detected