Skip to content

Disconnect SqliteStorage from ExtendedStorage API#31

Closed
dcaliste wants to merge 10 commits into
sailfishos:masterfrom
dcaliste:separate_1
Closed

Disconnect SqliteStorage from ExtendedStorage API#31
dcaliste wants to merge 10 commits into
sailfishos:masterfrom
dcaliste:separate_1

Conversation

@dcaliste
Copy link
Copy Markdown
Contributor

@pvuorela this is an example of PR that could be extracted from #28 without touching the public API.

The final goal is to make SqliteStorage API as simple (and disconnected from the one of ExtendedStorage) as possible. Ideally, it would one day inherit from a new StorageBackend interface with minimal functions, like some to load / save notebooks and some to load / save incidences. It should not be responsible of storing the incidences or monitoring the incidence storage. It should just be a incidences (+ notebooks) serialiser / deserialiser into / from an SQlite database.

It is based on the noptr branch that is targetted to be in soon. I'll rebase when it is the case.

The two commits are starting to separate the calendar handling (dedicated into ExtendedStorage) and the serialisation:

  • 4be475b is moving the calendar monitoring from SqliteStorage to ExtendedStorage. It's mainly code move between the two files. But it allows also to remove the state members like mIsLoading from SqliteStorage::Private. The load method is also now just sending a list of incidences to ExtendedStorage which is responsible to add them into its calendar.
  • d45a68f is a small commit to separate the tasks into calendar and DB when deleting a notebook. ExtendedStorage is responsible to remove the incidences from its calendar (and the alarms) while deleting the incidences is now done in SqliteStorage instead of reacting on calendar changes.

Notice : for the second commit, later on, I could create a dedicated SQlite statement to remove all components where notebook == nbuid instead of listing them and deleting them one by one as done now. But I was more concentrating on API revamp than code revamp.

The next step to the overall goal is to simplify the numerous load*() method from SqliteStorage and have a simple API here, leaving the numerous load methods to ExtendedStorage API only. I've done it (see my separate branch) and I'll see if it is othogonal to this PR and can be submitted alone, or if I need to wait for this one to go in first.

@dcaliste
Copy link
Copy Markdown
Contributor Author

dcaliste commented Dec 1, 2022

This is now superceeded by #37.

@dcaliste dcaliste closed this Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant