I have no use for kactivitymanager, I wanted to disable it but there is no way to do that in the settings menu. An option would be appreciated. The privacy settings also do not seem to be working, e.g.: 1) open sample file abcde.doc 2) from KDE's system settings > desktop behavior > activities > privacy, choose "do not remember", click "clear recent history" > forget everything, then "apply" 3) I expect the db to be clean now, but if I grep abcde.doc in my .local/share/kactivitymanagerd/resources/ directory, database-wal matches. If I delete the file and logout/login again, it's gone but I also lose the favorites icons in the applications menu. Note: I didn't choose a version in the bug report because the one I'm using was not in the list (5.13.4).
Any news about this bug?
Workaround: Create a script in cron that does this: #!/bin/bash sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'delete from ResourceInfo; pragma wal_checkpoint(TRUNCATE); vacuum;' sqlite3 ~/.local/share/kactivitymanagerd/resources/test-backup/database 'delete from ResourceInfo; pragma wal_checkpoint(TRUNCATE); vacuum;' sqlite3 ~/.local/share/kactivitymanagerd/resources/working-backup/database 'delete from ResourceInfo; pragma wal_checkpoint(TRUNCATE); vacuum;' Create a script in ~/.config/plasma-workspace/shutdown/ that does this: #!/bin/bash rm ~/.local/share/kactivitymanagerd/resources*/database-wal
Can someone please take a look at this? https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/service/plugins/sqlite/StatsPlugin.cpp#L66 I think that saveResourceMimetype and saveResourceTitle functions are lacking conditional check like addEvents does: if (m_blockAll || m_whatToRemember == NoApplications) { return; } https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/service/plugins/sqlite/StatsPlugin.cpp#L351
So, reading a bit the source code here: - Both saveResourceMimetype and saveResourceTitle call insertResourceInfo and then do an update - None of them have the "if" to check config - Both are also used as slots (linked to Resources signals) - Both have a callpath that leads to addEvent: detectResourceInfo <- openResourceEvent <- addEvents which is protected based on user settings So, _I think_ that the only way mimeType and title can leak is if the slot is called directly. However, these seem to be connected to the `m_resources` signals (Resources class) which in turn seem to only be exposed in dbus `kactivitymanagerd/src/common/dbus/org.kde.ActivityManager.Resources.xml` and not called anywhere directly. What I do see though is that StatsPlugin has: ``` enum WhatToRemember { AllApplications = 0, SpecificApplications = 1, NoApplications = 2, }; ``` but when I set the settings to "Do not remember" the config has: ``` $ grep what ~/.config/kactivitymanagerd-pluginsrc what-to-remember=1 ``` Similarly, when I set the setting to "Only for specific applications" I get: ``` $ grep what ~/.config/kactivitymanagerd-pluginsrc what-to-remember=2 ``` The values look flipped to me! I am struggling to locate the code that updates this config (lost somewhere in https://invent.kde.org/plasma/plasma-desktop/-/tree/master/kcms/recentFiles). Can anyone point me to where kactivitymanagerd-pluginsrc is written?
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1677
Git commit 5f1b83a69d8e462e4e27ca5bdefa8e3155be2817 by Méven Car, on behalf of Andreas Bontozoglou. Committed on 28/08/2023 at 15:39. Pushed by meven into branch 'master'. RecentFiles kcm: whattoremember: Make the value visible in the UI match the value saved In this commit: 1. Setting the property `kcfg_property=kcfg_value` on the QGroupBox. This should force the KConfigDialogManager to use that to retrieve that value that needs to be stored. 2. Introducing RecentFilesKcm::whatToRememberWidgetChanged which figures out the correct value of "what-to-remember" and sets it under the property `kcfg_value` and triggers the Save/Reset buttons. 3. Linking the above slot to the `QAbstractButton::clicked` signals of the radio buttons M +7 -0 kcms/recentFiles/CMakeLists.txt M +36 -2 kcms/recentFiles/kcm_recentFiles.cpp M +1 -0 kcms/recentFiles/kcm_recentFiles.h https://invent.kde.org/plasma/plasma-desktop/-/commit/5f1b83a69d8e462e4e27ca5bdefa8e3155be2817
(In reply to Andreas Bontozoglou from comment #4) > However, these seem to be connected to the `m_resources` > signals (Resources class) which in turn seem to only be exposed in dbus > `kactivitymanagerd/src/common/dbus/org.kde.ActivityManager.Resources.xml` > and not called anywhere directly. So it's called directly via dbus somewhere else. Here is debug log with print statements for addEvents, saveResourceTitle, saveResourceMimetype whenever I open any file in dolphin: > kactivitymanagerd[107123]: !!! saveResourceMimetype !!! uri [ "file:///home/serfreeman1337/kde/src/log/latest/kactivitymanagerd/build.log" ], mimetype [ "text/x-log" ], autoMimetype [ false ] > kactivitymanagerd[107123]: !!! addEvents !! m_blockAll [ false ], m_whatToRemember [ 2 ] saveResourceMimetype's called before addEvents. Re-opening this, since it was not solved by previous commit. STEPS TO REPRODUCE 1. In settings, set Workspace Behavior > Recent Files > Do not remember. 2. In dolphin, open any file. 3. Check ResourceInfo table with the following command: sqlite3 ~/.local/share/kactivitymanagerd/resources/database "SELECT * FROM ResourceInfo;" OBSERVED RESULT Information about just opened file has been filled in ResourceInfo, even though "Remember opened documents" is set to "Do not remember". EXPECTED RESULT No information about recent documents should be stored when "Remember opened documents" is set to "Do not remember". Easy way to solve this should be simply adding conditional checks for saveResourceMimetype and saveResourceTitle. Other way is to track down what is calling dbus signal and solve it there.
(In reply to serfreeman1337 from comment #7) I believe that fixing the config value is a prerequisite to fixing this bug since the user needs to be able to set recent files settings to "Do not remember". That said, indeed the bug is not completely fixed - I will make another MR soon
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kactivitymanagerd/-/merge_requests/52
Git commit 5e193ac52d6a1fdfba8a8ed5da504fb8ac7e3cd4 by Andreas Bontozoglou. Committed on 29/08/2023 at 11:46. Pushed by meven into branch 'master'. 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". M +8 -0 src/service/plugins/sqlite/StatsPlugin.cpp https://invent.kde.org/plasma/kactivitymanagerd/-/commit/5e193ac52d6a1fdfba8a8ed5da504fb8ac7e3cd4
Git commit 257acb4cdebd0aa10c50d547e919b451cbf7151e by Méven Car, on behalf of Andreas Bontozoglou. Committed on 04/09/2023 at 09:22. Pushed by meven into branch 'Plasma/5.27'. 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". (cherry picked from commit 5e193ac52d6a1fdfba8a8ed5da504fb8ac7e3cd4) M +8 -0 src/service/plugins/sqlite/StatsPlugin.cpp https://invent.kde.org/plasma/kactivitymanagerd/-/commit/257acb4cdebd0aa10c50d547e919b451cbf7151e
Git commit b57bf61d8d18cc4b7319b1af5514a8466761d321 by Méven Car, on behalf of Andreas Bontozoglou. Committed on 09/09/2023 at 11:04. Pushed by meven into branch 'Plasma/5.27'. RecentFiles kcm: whattoremember: Make the value visible in the UI match the value saved In this commit: 1. Setting the property `kcfg_property=kcfg_value` on the QGroupBox. This should force the KConfigDialogManager to use that to retrieve that value that needs to be stored. 2. Introducing RecentFilesKcm::whatToRememberWidgetChanged which figures out the correct value of "what-to-remember" and sets it under the property `kcfg_value` and triggers the Save/Reset buttons. 3. Linking the above slot to the `QAbstractButton::clicked` signals of the radio buttons (cherry picked from commit 5f1b83a69d8e462e4e27ca5bdefa8e3155be2817) M +7 -0 kcms/recentFiles/CMakeLists.txt M +36 -2 kcms/recentFiles/kcm_recentFiles.cpp M +1 -0 kcms/recentFiles/kcm_recentFiles.h https://invent.kde.org/plasma/plasma-desktop/-/commit/b57bf61d8d18cc4b7319b1af5514a8466761d321
It still doesn't work. Now, the settings "Do not remember" in "Recent files" doesn't save, and when I close that section of the KDE settings, it resets to "For all applications".
UI settings page is broken, yes. It isn't reflects current value when you re-open it. But it still sets correct "what-to-remember" param in "~/.config/kactivitymanagerd-pluginsrc" and "ResourceInfo" no longer filled when "Do not remember" is set.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1883
Git commit c641ae122fdf90e890e845aa1d8cb4ba8c42a8f2 by Méven Car, on behalf of Andreas Bontozoglou. Committed on 28/11/2023 at 14:26. Pushed by meven into branch 'master'. kcms/recentFiles: Restoring radio button state on load M +5 -0 kcms/recentFiles/kcm_recentFiles.cpp https://invent.kde.org/plasma/plasma-desktop/-/commit/c641ae122fdf90e890e845aa1d8cb4ba8c42a8f2
*** Bug 478665 has been marked as a duplicate of this bug. ***