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

Method closeNotebook

cmdtools/cmdlinetool.cpp:740–756  ·  view source on GitHub ↗

Close a notebook

Source from the content-addressed store, hash-verified

738
739// Close a notebook
740int CmdLineTool::closeNotebook(StartupConfig config) {
741 if (global.sharedMemory->attach()) {
742 std::cout << tr("This cannot be done with NixNote running.").toStdString() << endl;
743 return 16;
744 }
745 global.db = new DatabaseConnection("nixnote"); // Startup the database
746 NotebookTable bookTable(global.db);
747 for (int i=0; i<config.notebookList.size(); i++) {
748 qint32 lid = bookTable.findByName(config.notebookList[i]);
749 if (lid >0) {
750 bookTable.closeNotebook(lid);
751 } else {
752 std::cout << tr("Notebook not found: ").toStdString() << config.notebookList[i].toStdString() << endl;
753 }
754 }
755 return 0;
756}
757
758
759#include "models/notemodel.h"

Callers 1

runMethod · 0.45

Calls 2

attachMethod · 0.80
findByNameMethod · 0.45

Tested by

no test coverage detected