Bug 397602

Summary: Configuration files should contain only persistent configuration and not state
Product: [Frameworks and Libraries] frameworks-kconfig Reporter: Ben Creasy <ben>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: CONFIRMED ---    
Severity: task CC: a.samirh78, alexander.lohnau, alpeterson, ben, dconner.pro, elvis.angelaccio, jsardid, kde, kdelibs-bugs, kilgore.trout, kishore96, kubry, mail, mail, matheus4551, MurzNN, nate, openmail+kde, postix, qqqqqqqqq9, seqularise, yanth
Priority: NOR    
Version: 5.49.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=476854
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ben Creasy 2018-08-19 03:43:31 UTC
As a technical user who wants to monitor and experiment with configuration, I want to check my configuration into a git repository.

Currently, .dolphinrc contains temporary state (this is often placed into the XDG_DATA directory - see for example the discussion on Proposal: STATE Directory at https://wiki.debian.org/XDGBaseDirectorySpecification).

For example, a dolphinrc that I have contains the following:

[General]
Version=200
ViewPropsTimestamp=2018,4,26,4,16,4

[MainWindow]
Height 835=766
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAwAAAAAAAAC4AAAC2PwCAAAAAvsAAAAWAGYAbwBsAGQAZQByAHMARABvAGMAawAAAAAA/////wAAAAoBAAAD+wAAABQAcABsAGEAYwBlAHMARABvAGMAawEAAAAmAAAC2AAAAFoBAAADAAAAAQAAAAAAAAAA/AIAAAAB+wAAABAAaQBuAGYAbwBEAG8AYwBrAAAAAAD/////AAAACgEAAAMAAAADAAAAAAAAAAD8AQAAAAH7AAAAGAB0AGUAcgBtAGkAbgBhAGwARABvAGMAawAAAAAA/////wAAAAoBAAADAAACDwAAAtgAAAAEAAAABAAAAAgAAAAI/AAAAAEAAAACAAAAAQAAABYAbQBhAGkAbgBUAG8AbwBsAEIAYQByAQAAAAD/////AAAAAAAAAAA=
ToolBarsMovable=Disabled
Width 1432=712

Dimensions of windows, timestamps, and so on could be split out into a separate file. I believe that file should be in ~/.local/share/dolphin as a state file.

I think this should be an uncontroversial request - would a patch be accepted? If it is controversial, let me know how I can address any concerns!
Comment 1 Ben Creasy 2018-08-19 03:58:02 UTC
fyi I also submitted this to reddit for general discussion https://www.reddit.com/r/kde/comments/98hist/new_bugzilla_issue_dolphinrc_should_contain_only/
Comment 2 Ben Creasy 2018-08-19 04:01:24 UTC
I suppose I should clarify: dolphinrc currently does contain some state which I would describe as persistent configuration.

For example, if I enable "Use common properties for all folders", [General] is updated to add a line:
GlobalViewProps=true
Comment 3 Julian Steinmann 2018-08-19 14:58:44 UTC
This looks like a reasonable request, so I don't think that we would oppose any patches that'd implement this change. But because of our limited resources I cannot guarantee when and if we manage to write a patch, so the best option would be to create one yourself ;) I'll tag this as a bug, because we don't really follow XDG standards here.
Comment 4 David Edmundson 2018-08-19 16:54:48 UTC
>I think this should be an uncontroversial request

Mabye not, but doing it properly is not entirely trivial. Deep knowledge of every config key moved will be required.


>ToolBarsMovable=Disabled 

this definitely isn't state. So you're splitting things in the same config from the same code.

Also we would probably want some shared KConfig going around for state patches, so we'll need changes in KSharedConfig with the weak pointer storage.
Comment 5 Elvis Angelaccio 2018-08-20 14:10:21 UTC
This was discussed at the KConfig BoF at Akademy. It is something that would like to have, but it's not going to be easy. Moving to kconfig for now (as this is not dolphin-specific).
Comment 6 Ben Creasy 2020-01-25 03:26:26 UTC
Note: a bit of progress with this commit https://phabricator.kde.org/D26440 which adds a utility function for state files. I'm hopeful that with new features (e.g., https://phabricator.kde.org/T12192), the files will be clean of state.
Comment 7 Nate Graham 2020-08-12 16:12:29 UTC
*** Bug 425210 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2020-09-28 23:19:06 UTC
*** Bug 291222 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2021-04-30 16:31:29 UTC
*** Bug 436363 has been marked as a duplicate of this bug. ***
Comment 10 Alexander Lohnau 2021-09-15 17:07:28 UTC
See https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/76, but that has to wait for KF6 branching because of binary compatibility.

See also https://phabricator.kde.org/T12549, for the KF6 task which is actively being worked on.
Comment 11 Bug Janitor Service 2021-09-30 07:17:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/79
Comment 12 Bug Janitor Service 2021-09-30 07:18:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/279
Comment 13 Ahmad Samir 2021-10-07 13:40:32 UTC
Note that State= includes toolbars and dockwidgets (e.g. dolphin's places panel) locations/orientation; that isn't transient config IMHO.
Comment 14 Nate Graham 2021-10-07 14:35:38 UTC
Indeed.
Comment 15 Alexander Lohnau 2021-10-20 16:06:49 UTC
Git commit 52ef310d6b543d3db5de35aa4063c86708ba36ee by Alexander Lohnau.
Committed on 20/10/2021 at 05:22.
Pushed by alex into branch 'master'.

Allow apps to opt-in storing state data in separate file

Because it is opt-in the behavior of apps that use the config for
more complex session management does not change.

Task: https://phabricator.kde.org/T12549

M  +24   -10   src/kmainwindow.cpp
M  +17   -0    src/kmainwindow.h
M  +7    -0    src/kmainwindow_p.h

https://invent.kde.org/frameworks/kxmlgui/commit/52ef310d6b543d3db5de35aa4063c86708ba36ee
Comment 16 Alexander Lohnau 2021-10-22 08:43:07 UTC
Git commit b497dc9cbd1236790b5267710f5fb8370253d005 by Alexander Lohnau.
Committed on 20/10/2021 at 16:07.
Pushed by alex into branch 'master'.

Save size of config dialog in state config

M  +2    -2    src/settings/dolphinsettingsdialog.cpp

https://invent.kde.org/system/dolphin/commit/b497dc9cbd1236790b5267710f5fb8370253d005
Comment 17 Alexander Lohnau 2021-10-22 08:43:16 UTC
Git commit 946b911a5d340d7672db9802579f658aeba738b0 by Alexander Lohnau.
Committed on 20/10/2021 at 16:07.
Pushed by alex into branch 'master'.

Utilize KXMLGUI API to store state config in separate file

M  +5    -0    src/dolphinmainwindow.cpp

https://invent.kde.org/system/dolphin/commit/946b911a5d340d7672db9802579f658aeba738b0
Comment 18 Nate Graham 2023-04-26 18:53:33 UTC
*** Bug 468997 has been marked as a duplicate of this bug. ***
Comment 19 Alexander Lohnau 2023-12-25 11:14:15 UTC
https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/211 took care of enabling the state separation by default.
Comment 20 Alexander Lohnau 2023-12-25 15:40:07 UTC
I think on the frameworks side, we have resolved with this bug. I will need to look into a few dolphin specific cases in order to tangle the remaining issues.