Find a shared notebook by the share key
| 394 | |
| 395 | // Find a shared notebook by the share key |
| 396 | qint32 SharedNotebookTable::findByShareKey(QString id) { |
| 397 | NSqlQuery query(db); |
| 398 | db->lockForRead(); |
| 399 | query.prepare("Select lid from DataStore where key=:key and data=:id"); |
| 400 | query.bindValue(":key", SHAREDNOTEBOOK_SHARE_KEY); |
| 401 | query.bindValue(":id", id); |
| 402 | query.exec(); |
| 403 | while (query.next()) { |
| 404 | qint32 retval = query.value(0).toInt(); |
| 405 | query.finish(); |
| 406 | db->unlock(); |
| 407 | return retval; |
| 408 | } |
| 409 | db->unlock(); |
| 410 | query.finish(); |
| 411 | return 0; |
| 412 | } |
| 413 | |
| 414 | |
| 415 | // Find a shared notebook by the share key |