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

Method getOpenNotebooks

sql/notebooktable.cpp:1097–1111  ·  view source on GitHub ↗

Get a list of any notebooks that are open and return a list of LIDs.

Source from the content-addressed store, hash-verified

1095// Get a list of any notebooks that are open and
1096// return a list of LIDs.
1097void NotebookTable::getOpenNotebooks(QList<qint32> &lids) {
1098 lids.empty();
1099 NSqlQuery query(db);
1100 db->lockForRead();
1101 query.prepare("Select lid from DataStore where key=:key and lid not in (select lid from datastore where key=:key2)");
1102 query.bindValue(":key", NOTEBOOK_GUID);
1103 query.bindValue(":key2", NOTEBOOK_IS_CLOSED);
1104 query.exec();
1105 while (query.next()) {
1106 qint32 lid = query.value(0).toInt();
1107 lids.append(lid);
1108 }
1109 query.finish();
1110 db->unlock();
1111}
1112
1113
1114// Open all notebooks. Really we just delete the

Callers 1

CloseNotebookDialogMethod · 0.80

Calls 6

lockForReadMethod · 0.80
bindValueMethod · 0.80
valueMethod · 0.80
prepareMethod · 0.45
execMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected