MCPcopy Create free account
hub / github.com/codestation/qcma / create

Method create

common/sqlitedb.cpp:257–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257int SQLiteDB::create()
258{
259 int total_objects = 0;
260
261 db.transaction();
262
263 if(!insertVirtualEntries()) {
264 db.rollback();
265 return -1;
266 }
267
268 for(int i = 0, max = sizeof(ohfi_array) / sizeof(int); i < max; i++) {
269 QString base_path = getBasePath(ohfi_array[i]);
270 int dir_count = recursiveScanRootDirectory(base_path, NULL, ohfi_array[i], ohfi_array[i]);
271
272 if(dir_count < 0) {
273 db.rollback();
274 return -1;
275 }
276
277 //qDebug("Added %i objects for OHFI %#02X", dir_count, ohfi_array[i]);
278
279 total_objects += dir_count;
280 }
281 db.commit();
282 return total_objects;
283}
284
285QString SQLiteDB::getBasePath(int root_ohfi)
286{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected