MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / set

Method set

src/utils/CliRemoteController.cpp:151–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151bool CliRemoteController::set(const QString &keyValue) const
152{
153 QPair<QString, QVariant> out;
154 bool validLine = ConfigIO::readLine(keyValue, out);
155 if(!validLine) {
156 Log::error("Syntax error. Please use this format: --set key=value or --set \"key=value with spaces\".");
157 return false;
158 }
159
160 QString key = out.first;
161 QVariant value = out.second;
162
163 if(!checkConnectionAndLog()) {
164 DspConfig::Key resolvedKey;
165 bool valid = validateKey(key, resolvedKey);
166 if(!valid)
167 return false;
168
169 DspConfig::instance().set(resolvedKey, value);
170 DspConfig::instance().save();
171 return true;
172 }
173
174 auto reply = service->setAndCommit(key, QDBusVariant(value));
175 return handleVoidReply(reply);
176}
177
178bool CliRemoteController::get(const QString &key) const
179{

Callers

nothing calls this directly

Calls 4

validateKeyFunction · 0.85
handleVoidReplyFunction · 0.85
saveMethod · 0.45
setAndCommitMethod · 0.45

Tested by

no test coverage detected