[WriteTransaction] Make WriteTransaction a subclass of Transaction

Igor Poboiko requested to merge poboiko/baloo:writetrans into master

This patch refactors Transaction / WriteTransaction code. It solves following issues:

  • Checks whether one is allowed to perform write operations on DB are performed at compile time instead of having bug-prone asserts. Now one has to use Transaction for read-only access and WriteTransaction for read-write access.
  • All modify operations are moved to WriteTransaction. Previously Transaction contained some code which actually modified the DB (setPhaseOne, removePhaseOne and addFailed), which contradicted the original idea of separation read-only and read-write access by having two classes.
  • It also allows to simplify the Transaction code and drop shallow write-related proxy-methods that forwarded those calls to WriteTransaction.

The only transaction-related test (testTimeInfo) actually tested read-write operations, so it's moved to WriteTransactionTest.

Merge request reports