MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / RenameNode

Method RenameNode

Src/Database/DatabaseTree.cpp:273–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273bool 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
291bool CDatabaseNode::DeleteNode(
292 int id, std::function<bool (int)> cbDeleteLeaf, bool checkReturn)

Callers 2

setDataMethod · 0.80
renameFolderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected