[mkcal] Add a new table to store custom properties for notebooks.
This MR is adding support for key / value storage for notebooks. This can be usefull to avoid abusing other fields to store information not necessarily generic enough to have their own API, like notebook ctag in CalDAV or notebook root URL for CalDAV also. I've seen a MR about Google calendar handling that would benefit from this.
I'm providing a test for the new functionality. Storage is done in a separated new table, like the customproperties one, but for calendars instead of components. This addition is fully backward compatible with existing database layout since it's an addition, so I didn't change the VersionMajor and VersionMinor in sqlitestorage.h.
- there are three new methods in
addCustomProperty()which is a setter, the
customProperty()which is a getter and the
customPropertyKeys()which is mainly used in the sqliteformat implementation for dumping action. Should I move the later one into a private section and make SqliteFormat be a friend of this method ? In addition, the setter method is called 'add' something, but as the documentation is mentioning, passing an empty value results in the property being removed. Is it an issue ? I don't really want to create a 'remove' something method, particularly because I don't want to let the possibility to store empty values. What do you think ?
- the new table layout is referencing the CalendarId from the 'calendars' table. This field is a string, not an integer. So it means that a 'where' clause is matching strings, not numbers. Do you think it can really be an issue in practice where we don't have many notebooks and not many custom properties per notebook ? I've created an index on this field anyway to hash the content. The other solution would be to refer to the rowid of calendars instead of the CalendarId, but it requires to change the select of the select_calendars_all query to fetch the rowid also. What do you think ?