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

Method checkReadOnlyNotebook

nixnote.cpp:1650–1666  ·  view source on GitHub ↗

Check if the notebook selected is read-only. With read-only notes the editor and a lot of actions are disabled.

Source from the content-addressed store, hash-verified

1648//* read-only notes the editor and a lot of actions are disabled.
1649//******************************************************************
1650void NixNote::checkReadOnlyNotebook() {
1651 qint32 lid = tabWindow->currentBrowser()->lid;
1652 Note n;
1653 NoteTable ntable(global.db);
1654 NotebookTable btable(global.db);
1655 ntable.get(n, lid, false, false);
1656 qint32 notebookLid = 0;
1657 if (n.notebookGuid.isSet())
1658 notebookLid = btable.getLid(n.notebookGuid);
1659 if (btable.isReadOnly(notebookLid)) {
1660 newNoteButton->setEnabled(false);
1661 menuBar->deleteNoteAction->setEnabled(false);
1662 } else {
1663 newNoteButton->setEnabled(true);
1664 menuBar->deleteNoteAction->setEnabled(true);
1665 }
1666}
1667
1668
1669

Callers

nothing calls this directly

Calls 6

currentBrowserMethod · 0.80
isReadOnlyMethod · 0.80
setEnabledMethod · 0.80
getMethod · 0.45
isSetMethod · 0.45
getLidMethod · 0.45

Tested by

no test coverage detected