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

Method get

sql/filewatchertable.cpp:68–100  ·  view source on GitHub ↗

Get an individual record

Source from the content-addressed store, hash-verified

66
67// Get an individual record
68void FileWatcherTable::get(qint32 lid, QString &baseDir, FileWatcher::ScanType &type, qint32 &notebookLid, bool &includeSubdirs) {
69 NSqlQuery sql(db);
70 db->lockForRead();
71 sql.prepare("Select key, data from DataStore where lid=:lid");
72 sql.bindValue(":lid", lid);
73 sql.exec();
74
75 while(sql.next()) {
76 int key = sql.value(0).toInt();
77 switch(key) {
78 case FILE_WATCHER_DIR :
79 baseDir = sql.value(1).toString();
80 break;
81 case FILE_WATCHER_NOTEBOOK :
82 notebookLid = sql.value(1).toInt();
83 break;
84 case FILE_WATCHER_SUBDIRS :
85 includeSubdirs = sql.value(1).toBool();
86 break;
87 case FILE_WATCHER_TYPE : {
88 int value = sql.value(1).toInt();
89 if (value == FileWatcher::ImportDelete)
90 type = FileWatcher::ImportDelete;
91 else
92 type = FileWatcher::ImportKeep;
93 }
94 default :
95 break;
96 }
97 }
98 db->unlock();
99 sql.finish();
100}
101
102
103

Callers

nothing calls this directly

Calls 7

lockForReadMethod · 0.80
bindValueMethod · 0.80
valueMethod · 0.80
prepareMethod · 0.45
execMethod · 0.45
toStringMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected