Bug 441575

Summary: konversation should separate state config from settings config
Product: [Applications] konversation Reporter: Till Schäfer <till2.schaefer>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau
Priority: NOR    
Version: 1.8.21082   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://phabricator.kde.org/T12549
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Till Schäfer 2021-08-26 14:08:24 UTC
Currently konversation saves the application settings together with the application state (e.g. recently opened files/directories) in a single configuration file (~/.config/konversationrc here).
This causes the configurations to change frequently and make it hard to compare them, which is an issue when synchronizing settings, e.g. in a dotfile repository.

Therefore, I propose to separate application setting from application state. KConfig also provides a mechanism for this: KSharedConfig::openStateConfig (see https://api.kde.org/frameworks/kconfig/html/classKSharedConfig.html#a5dcfbe60478f169753342d37212c1b58 )

Observed states in kid3rc so far:
* Group MainWindow
* Several splitter positions, e.g., under group Appearance


Operating System: Gentoo Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.12-gentoo (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4810MQ CPU @ 2.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600
Comment 1 Till Schäfer 2021-11-03 09:39:20 UTC
see also https://phabricator.kde.org/T12549 - Remove state data from config files
Comment 2 Alexander Lohnau 2021-11-03 09:53:27 UTC
I will work on a fix once the current frameworks master is released. That contains some logic in KXMLGUI & utility methods in KConfig to move config entries from one group to another.

>Observed states in kid3rc so far:

Is this related to Konversation?
Comment 3 Till Schäfer 2021-11-03 10:00:01 UTC
(In reply to Alexander Lohnau from comment #2)
> I will work on a fix once the current frameworks master is released. That
> contains some logic in KXMLGUI & utility methods in KConfig to move config
> entries from one group to another.
cool

> 
> >Observed states in kid3rc so far:
> 
> Is this related to Konversation?

Copy & Paste Error.  I have also opened a similar bug report for Kid3.
The data below is correct -> simply apply s/kid3rc/konversationrc/ :)
Comment 4 Alexander Lohnau 2021-12-16 07:00:14 UTC
In case you can try out a patch: https://invent.kde.org/network/konversation/-/merge_requests/61
Comment 5 Alexander Lohnau 2021-12-28 06:30:34 UTC
Git commit 7b767a0acbbf5804fafb7c52ac6c2f8db6fc0459 by Alexander Lohnau.
Committed on 27/12/2021 at 20:54.
Pushed by alex into branch 'master'.

Store state data in separate config file

For migrating the old data we can utilize the KConfigGroup::moveValuesTo method.
For the state config a new kcfg file is added.

Relates to https://phabricator.kde.org/T12549.

M  +1    -0    src/CMakeLists.txt
M  +2    -0    src/application.cpp
M  +0    -15   src/config/konversation.kcfg
A  +23   -0    src/config/konversation_state.kcfg
A  +8    -0    src/config/konversation_state.kcfgc
M  +9    -8    src/irc/channel.cpp
M  +1    -0    src/mainwindow.cpp
M  +9    -2    src/viewer/viewcontainer.cpp

https://invent.kde.org/network/konversation/commit/7b767a0acbbf5804fafb7c52ac6c2f8db6fc0459
Comment 6 Till Schäfer 2022-05-23 09:28:13 UTC
related merge request: Store DCCRecipientDialog window size in state config

https://invent.kde.org/network/konversation/-/merge_requests/77
Comment 7 Till Schäfer 2022-05-23 09:57:35 UTC
related Bug 454262: konversation does change order of identities in config file