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

Method getConflictNotebook

sql/notebooktable.cpp:958–983  ·  view source on GitHub ↗

Get the LID of the conflict notebook

Source from the content-addressed store, hash-verified

956
957// Get the LID of the conflict notebook
958qint32 NotebookTable::getConflictNotebook() {
959 NSqlQuery query(db);
960 db->lockForRead();
961 query.prepare("Select lid from datastore where data like 'Conflict%' and key=:key");
962 query.bindValue(":key", NOTEBOOK_NAME);
963 query.exec();
964 int i=0;
965 while (query.next()) {
966 qint32 lid = query.value(0).toInt();
967 if (isLocal(lid))
968 return lid;
969 i++;
970 }
971 query.finish();
972 db->unlock();
973
974 // If there is no conflict notebook, we create one
975 Notebook n;
976 if (i>0)
977 n.name = "Conflict-" +QString::number(i);
978 else
979 n.name = "Conflict";
980 n.updateSequenceNum = 0;
981 return add(0,n,true,true);
982
983}
984
985
986

Callers 1

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