| 271 | } |
| 272 | |
| 273 | bool CDatabaseNode::RenameNode(int id, const QString &newName) |
| 274 | { |
| 275 | QSqlQuery query(GetDatabase()); |
| 276 | query.prepare("UPDATE `" + m_szTableName + "` " |
| 277 | " SET `name` = :name WHERE `id` = :id"); |
| 278 | query.bindValue(":id", id); |
| 279 | query.bindValue(":name", newName); |
| 280 | bool bRet = query.exec(); |
| 281 | if (bRet) |
| 282 | emit sigChanged(); |
| 283 | else { |
| 284 | SetError("Failed to rename folders: " + query.lastError().text() |
| 285 | + "; Sql: " + query.executedQuery()); |
| 286 | qCritical(log) << GetError(); |
| 287 | } |
| 288 | return bRet; |
| 289 | } |
| 290 | |
| 291 | bool CDatabaseNode::DeleteNode( |
| 292 | int id, std::function<bool (int)> cbDeleteLeaf, bool checkReturn) |
no outgoing calls
no test coverage detected