Get a count of all new unsequenced notebooks
| 986 | |
| 987 | // Get a count of all new unsequenced notebooks |
| 988 | int NotebookTable::getNewUnsequencedCount() { |
| 989 | db->lockForRead(); |
| 990 | NSqlQuery query(db); |
| 991 | query.prepare("Select count(lid) from DataStore where key=:key and data=0 and lid not in (select lid from datastore where key=:localkey and data=1)"); |
| 992 | query.bindValue(":key", NOTEBOOK_UPDATE_SEQUENCE_NUMBER); |
| 993 | query.bindValue(":localkey", NOTEBOOK_IS_LOCAL); |
| 994 | query.exec(); |
| 995 | qint32 retval = 0; |
| 996 | while(query.next()) { |
| 997 | retval = query.value(0).toInt(); |
| 998 | } |
| 999 | query.finish(); |
| 1000 | db->unlock(); |
| 1001 | return retval; |
| 1002 | } |
| 1003 | |
| 1004 | |
| 1005 |