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

Method alterNote

cmdtools/cmdlinetool.cpp:700–716  ·  view source on GitHub ↗

Alter a note's notebook or add/remove tags for a note.

Source from the content-addressed store, hash-verified

698
699// Alter a note's notebook or add/remove tags for a note.
700int CmdLineTool::alterNote(StartupConfig config) {
701 // Look to see if another NixNote is running. If so, then we
702 // expect a response, otherwise we do it ourself.
703 bool useCrossMemory = true;
704 global.sharedMemory->unlock();
705 global.sharedMemory->detach();
706 if (!global.sharedMemory->attach()) {
707 useCrossMemory = false;
708 }
709 if (useCrossMemory) {
710 global.sharedMemory->write("ALTER_NOTE:" + config.alter->wrap());
711 } else {
712 global.db = new DatabaseConnection("nixnote"); // Startup the database
713 return config.alter->alterNote();
714 }
715 return 0;
716}
717
718
719// Open a notebook

Callers 1

runMethod · 0.45

Calls 5

detachMethod · 0.80
attachMethod · 0.80
unlockMethod · 0.45
writeMethod · 0.45
wrapMethod · 0.45

Tested by

no test coverage detected