Skip to content

Only reload sessions in dataengine when relevant files/paths change

Alexander Lohnau requested to merge work/alex/cleanup_dataengine into master

When debugging the dataengine I noticed that the updateSessions slot gets called very often. This is because the KDirWatch::dirty slot gets also emitted for unrelated files which will just cause unnecessary reloading. For instance if you open the session picker, rename it and open another session and close the sessions the dataengine loads the sessions ~100 times.

With this MR only changes to the base directory (this will be triggered by add/delete operations) and changes to the sessionrc files will trigger a reload. Now the sessions are reloaded only a couple of times, but the data is still up to date.

Test Plan:
Add this plasmoid to your panel or desktop. The sessions should be displayed.
Open a session and rename it, the changes should take immediately effect.
Create a new session and import a project, this should also be displayed.
Delete the new session, it should be removed from the plasmoid.

Edited by Alexander Lohnau

Merge request reports