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

Method findByShareKey

sql/sharednotebooktable.cpp:396–412  ·  view source on GitHub ↗

Find a shared notebook by the share key

Source from the content-addressed store, hash-verified

394
395// Find a shared notebook by the share key
396qint32 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

Callers 1

syncMethod · 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