Get a list of any notebooks that are open and return a list of LIDs.
| 1095 | // Get a list of any notebooks that are open and |
| 1096 | // return a list of LIDs. |
| 1097 | void 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 |
no test coverage detected