| 211 | } |
| 212 | |
| 213 | void Storage::UpdateProject(AuthProfile profile) |
| 214 | { |
| 215 | QJsonObject json; |
| 216 | json["host"] = profile.GetHost(); |
| 217 | json["port"] = profile.GetPort(); |
| 218 | json["endpoint"] = profile.GetEndpoint(); |
| 219 | json["username"] = profile.GetUsername(); |
| 220 | json["password"] = profile.GetPassword(); |
| 221 | json["projectDir"] = profile.GetProjectDir(); |
| 222 | json["subscriptions"] = QJsonArray::fromStringList(profile.GetSubscriptions()); |
| 223 | json["consoleMultiuser"] = profile.GetConsoleMultiuser(); |
| 224 | QString data = QJsonDocument(json).toJson(QJsonDocument::Compact); |
| 225 | |
| 226 | QSqlQuery query(QSqlDatabase::database(DB_CONNECTION_NAME)); |
| 227 | query.prepare("UPDATE Projects SET data = :Data WHERE project = :Project;"); |
| 228 | query.bindValue(":Project", profile.GetProject()); |
| 229 | query.bindValue(":Data", data); |
| 230 | if (!query.exec()) |
| 231 | LogError("The project has not been updated in the database: %s\n", query.lastError().text().toStdString().c_str()); |
| 232 | } |
| 233 | |
| 234 | void Storage::RemoveProject(const QString &project) |
| 235 | { |
no test coverage detected