Bug 397602 - Configuration files should contain only persistent configuration and not state
Summary: Configuration files should contain only persistent configuration and not state
Status: CONFIRMED
Alias: None
Product: frameworks-kconfig
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.49.0
Platform: Other Linux
: NOR task
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
: 291222 425210 436363 468997 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-19 03:43 UTC by Ben Creasy
Modified: 2024-01-14 17:50 UTC (History)
23 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.