SyncJournalDB: Allow callers of getFileRecord if the query failed
authorJocelyn Turcotte <jturcotte@woboq.com>
Wed, 13 Sep 2017 17:02:38 +0000 (19:02 +0200)
committerOlivier Goffart <olivier@woboq.com>
Tue, 26 Sep 2017 09:03:23 +0000 (11:03 +0200)
commit6f46764daa59460a4cbdc7327255a6dc4d631590
tree48f83f647f7517d77f352ab5ce707a41c3d8d4d4
parente1d482ea7cded147dbac5c799a81d13687d9db99
SyncJournalDB: Allow callers of getFileRecord if the query failed

The current implementation would return the same value whether the query failed
or if no row would be found. This is something that is currently checked by csync
and needs to be provided if we want to use SyncJournalDB there.

Adjusted all call sites to also check the return value even though they
could still just rely on rec.isValid(), but makes it more explicit as to what
happens for database errors in those cases, if we ever want to gracefully handle
them.
13 files changed:
src/common/syncjournaldb.cpp
src/common/syncjournaldb.h
src/gui/folder.cpp
src/gui/owncloudgui.cpp
src/gui/socketapi.cpp
src/libsync/owncloudpropagator.cpp
src/libsync/propagatedownload.cpp
src/libsync/propagateremotemove.cpp
src/libsync/propagatorjobs.cpp
src/libsync/syncengine.cpp
src/libsync/syncfilestatustracker.cpp
test/testsyncengine.cpp
test/testsyncjournaldb.cpp