Make SqliteStorage independant of any calendar. #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@pvuorela, this is an attempt implementation of some ideas we exchanged on IRC about making the SQLite storage independant from any calendar. The overview is the following :
StorageBackendclass that takes the methods from ExtendedCalendar related to database handling but that does not require any calendar, just incidences and their notebook ids.ExtendedStoragea link between the SQLite backend storage and an ExtendedCalendar, using only observer methods. To keep backward compatibility on it, it is inheriting SqliteStorage instead of CalStorage now. The previous behaviour should be kept.From a positive point of view, tests are still passing. From a negative one, I had to break the API compatibility on ExtendedStorageObserver, since it has been moved to StorageBackend. As far as I know, it was only used in the QML binding (recent addition, you know) and it should be simple to update it.
Some technical notes :
QMultiHash<QString, Incidence::Ptr>containers. Such containers have been typedef toCollectionfor briefty.I'm submitting this before implementing the threaded version to discuss with you if it's valuable or going in the right direction. If so, I'll create a
ThreadedStorageclass that will basically do the same than the currentExtendedStorageone but with the SQLite backend living in a different thread.