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

Method openNotebook

cmdtools/cmdlinetool.cpp:720–736  ·  view source on GitHub ↗

Open a notebook

Source from the content-addressed store, hash-verified

718
719// Open a notebook
720int CmdLineTool::openNotebook(StartupConfig config) {
721 if (global.sharedMemory->attach()) {
722 std::cout << tr("This cannot be done with NixNote running.").toStdString() << endl;
723 return 16;
724 }
725 global.db = new DatabaseConnection("nixnote"); // Startup the database
726 NotebookTable bookTable(global.db);
727 for (int i=0; i<config.notebookList.size(); i++) {
728 qint32 lid = bookTable.findByName(config.notebookList[i]);
729 if (lid >0) {
730 bookTable.openNotebook(lid);
731 } else {
732 std::cout << tr("Notebook not found: ").toStdString() << config.notebookList[i].toStdString() << endl;
733 }
734 }
735 return 0;
736}
737
738
739// Close a notebook

Callers 1

runMethod · 0.45

Calls 2

attachMethod · 0.80
findByNameMethod · 0.45

Tested by

no test coverage detected