Bug 400054 - DirSelect Dialog saves history in kdeglobals
Summary: DirSelect Dialog saves history in kdeglobals
Status: CONFIRMED
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: 5.13.4
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-20 04:03 UTC by Shreyansh Jain
Modified: 2025-03-15 11:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shreyansh Jain 2018-10-20 04:03:20 UTC
Please direct me to correct place if this report doesn't belongs here.

KDE currently saves the local item history in $HOME/.config/.kdeglobals file in the [DirSelect Dialog] under "History Items[$e]" key. This field is constantly changing with usage and ideally doesn't belong in $HOME/.config but somewhere in $HOME/.local because of it's nature.

I'd like to version control KDE configuration in a git repository but since this file keeps on changing due to this key, I'm unable to commit my configuration.

Thank you.

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.13.4
KDE Frameworks Version: 5.49.0
Qt Version: 5.11.1

KDE Plasma on NixOS 18.09 based on commit 09195057114a0a8d112c847a9a8f52957420857d
( https://github.com/NixOS/nixpkgs-channels/tree/09195057114a0a8d112c847a9a8f52957420857d )
Comment 1 Kai Uwe Broulik 2018-10-22 06:54:34 UTC
It is configuration and as such belongs in .config and this will not be changed.

However, it shouldn't be writing into kdeglobals but the app-specific config file, e.g dolphinrc. Can you pin-point which application does those writes? Judging from plasma-integration code it shouldn't be writing into kdeglobals.
Comment 2 Shreyansh Jain 2018-10-22 09:14:45 UTC
(In reply to Kai Uwe Broulik from comment #1)
> Can you pin-point which application does those writes?

I can offer to follow your instructions as I have no idea on how pin-point it. It occurs sporadically and I don't know what triggers it.

> It is configuration and as such belongs in .config and this will not be changed.

Please reconsider. Configuration files should not change frequently (unless application version changes) and ideally should remain static and portable between machines.
The program generates fields like this:
```
[DirSelect Dialog]
DirSelectDialog Size=640,480
History Items[$e]=file:///some/path/on/local/computer
```
Clearly, these fields are set on runtime and change frequently. More appropriate location for this data is in "$HOME/.local". I'm adding user profile to VCS and these fields make me push a new commit everyday. I use git to sync my configuration across various machines and they're not holding anything that needs to be taken when switching computers.
Comment 3 Luke Horwell 2025-03-15 11:16:51 UTC
Can confirm KDirSelectDialog is saving history into ~/.config/kdeglobals.

With today's Plasma 6.3, saving history when selecting directories seems redundant. None of the programs I tried (KDE and non-KDE) actually read this history nor have a recents menu because the program will set the initial folder. ($HOME in most cases)
Comment 4 Luke Horwell 2025-03-15 11:30:30 UTC
Regarding my last comment, I made a mistake. Turns out history is used for the combo box (drop down), but obviously will be the same across all applications (globally). Ideally would be stored per-app in the *rc files if it is to be consistent with KFileDialog.

A quick way to test this dialog is with kdialog:

> kdialog --getexistingdirectory [initial path]