MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / renameStack

Method renameStack

sql/notebooktable.cpp:759–774  ·  view source on GitHub ↗

Rename the stack for this notebook

Source from the content-addressed store, hash-verified

757
758// Rename the stack for this notebook
759void NotebookTable::renameStack(QString oldName, QString newName) {
760 QList<qint32> lids;
761 findByStack(lids, oldName);
762 NSqlQuery query(db);
763 db->lockForWrite();
764 query.prepare("Update Datastore set data=:newname where key=:key and data=:oldname");
765 query.bindValue(":newname", newName);
766 query.bindValue(":key", NOTEBOOK_STACK);
767 query.bindValue(":oldname", oldName);
768 query.exec();
769 query.finish();
770 db->unlock();
771
772 for (qint32 i=0; i<lids.size(); i++)
773 setDirty(lids[i], true);
774}
775
776
777

Callers 1

editCompleteMethod · 0.45

Calls 5

lockForWriteMethod · 0.80
bindValueMethod · 0.80
prepareMethod · 0.45
execMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected