Address SQLCipher/Sqlite3 redundancy
KMyMoney currently attempts to support both SQLCipher and SQLite3 via respective plugins. This is, however, a futile effort because both of them share the same namespace, so technically speaking only one plugin can be loaded at a time – which the original developer noted in the code (https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/plugins/sql/mymoneydbdriver.cpp#L155). Moreover, SQLCipher is as a stand-in API-level replacement for the SQLite and provides all its functionality already, so supporting SQLite3 separately is a pure redundancy.
This causes following issues:
- SQLCipher blueprint is unnecessarily convoluted in attempt to make its libraries be distributable alongside SQLite's own: https://invent.kde.org/packaging/craft-blueprints-kde/-/blob/master/libs/sqlcipher/sqlcipher.py
- this in turn causes issues like https://bugs.kde.org/show_bug.cgi?id=419272
- the blueprint should instead be pretty much just a copy of SQLite3's own: https://invent.kde.org/packaging/craft-blueprints-kde/-/blob/master/libs/sqlite/sqlite.py
- KMyMoney code is also unnecessarily convoluted. The SQL support could be served by a single plugin instead and rely on SQLCipher to provide basic SQLite3 support and encryption and the same time.
Tasklist:
-
Add a libsqlcipher blueprint to craft (wrobelda/craft-blueprints-kde@ea2effb2) -
Update the sqlcipher craft blueprint, address 1. above (wrobelda/craft-blueprints-kde@a90fb393) -
Delete the plugins\sqlcipher
copy of the libsqlcipher code (515459af) -
Add a 3rdparty\ext_libsqlcipher\CMakeLists.txt
(515459af) -
Modify the cmake files remove the parts responsible for handling sqlite and sqlcipher simultaneously. Make them exclusive. (515459af) -
Modify the code so that both plugins (sqlite and sqlcipher) present themselves as sqlite in the UI. The only difference observable should be the encryption support. (See also https://forum.kde.org/viewtopic.php?f=69&t=161485&p=434932#p434932 and design it so that it avoids confusion) -
Check the unit tests and amend if needed -
Build and test everything on each platform
Also consider switching to https://github.com/utelle/SQLite3MultipleCiphers instead of the SqlCipher
Edited by Dawid Wrobel