plugins/sqlite: Skipping insert/update when m_blockAll or m_whatToRemember==NoApplications
Adding an if-statement in both saveResourceTitle
and saveResourceMimetype
to skip inserting/updating the sqlite database (ResourceInfo table) if the
user has configured kamd/recentFiles with "Do not remember".
Testing
Ensure we are in "Do not remember":
$ grep what ~/.config/kactivitymanagerd-pluginsrc
what-to-remember=2
Build and replace the kamd:
src/kdesrc-build/kdesrc-build kactivitymanagerd --no-include-dependencies --no-src \
&& sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'delete from ResourceInfo;' \
&& sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from ResourceInfo;' \
&& systemctl --user disable --now plasma-kactivitymanagerd \
&& build/kactivitymanagerd/bin/kactivitymanagerd
Once the above is running, in another terminal:
- Must be empty: sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from ResourceInfo;'
- Open some file in dolphin
- Must be empty: sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from ResourceInfo;'
Repeated the above with what-to-remember 0 / 1 values and made sure that entries are still being added to the database.
(restore with systemctl --user enable --now plasma-kactivitymanagerd)
Edited by Andreas Bontozoglou