| 149 | } |
| 150 | |
| 151 | bool 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 | |
| 178 | bool CliRemoteController::get(const QString &key) const |
| 179 | { |
nothing calls this directly
no test coverage detected