comparison SqliteDBLink.cpp @ 95:7c935d3d5b74

Better signify when starting update of checksums.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Tue, 22 Oct 2013 14:22:00 +0200
parents 93981e675d67
children c7da835ea912
comparison
equal deleted inserted replaced
94:93981e675d67 95:7c935d3d5b74
294 checksums.clear(); 294 checksums.clear();
295 } 295 }
296 296
297 bool SqliteDBLink::commit() 297 bool SqliteDBLink::commit()
298 { 298 {
299 int n = 0;
300 OperationType last = None; 299 OperationType last = None;
301 QVariantList paths, sizes, mtimes, hashes; 300 QVariantList paths, sizes, mtimes, hashes;
302 301
303 foreach(const Operation& operation, operations) { 302 foreach(const Operation& operation, operations) {
304 if (operation.second != last) { 303 if (operation.second != last) {
331 int pathIndex = whatToUpdate.record().indexOf("path"); 330 int pathIndex = whatToUpdate.record().indexOf("path");
332 QStringList updatePaths; 331 QStringList updatePaths;
333 while (whatToUpdate.next()) { 332 while (whatToUpdate.next()) {
334 updatePaths << whatToUpdate.value(pathIndex).toString(); 333 updatePaths << whatToUpdate.value(pathIndex).toString();
335 } 334 }
335 int n = 0;
336 int max = updatePaths.size(); 336 int max = updatePaths.size();
337 emit progressUpdate(0, max);
337 QSqlQuery updateChecksum(db); 338 QSqlQuery updateChecksum(db);
338 updateChecksum.prepare("UPDATE files " 339 updateChecksum.prepare("UPDATE files "
339 "SET checksum=:checksum " 340 "SET checksum=:checksum "
340 "WHERE path=:path"); 341 "WHERE path=:path");
341 342