Store and fetch complete view config in and from session config
ClosedPublic

Authored by kossebau on Mar 4 2020, 6:38 PM.

Details

Summary

The manual "Dynamic Word Wrap" config key is also the key used by the
generic config for this parameter, so config-backward-compatible change.

Test Plan

Saving & loading a KDevelop session now restores more of the view settings,
like which borders are shown.

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mar 4 2020, 6:38 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 4 2020, 6:38 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 4 2020, 6:38 PM

I am a bit surprised this was not already done before? Did I miss something?

Settings like color scheme & zoom are not yet covered, but they might want to be restored as well fpr completeness, or? If someone changed them from the general settings, they might have had a reason, and that might still be present after session restore.

cullmann accepted this revision as: cullmann.Mar 7 2020, 4:10 PM

Hmm, actually not sure why we didn't do that before.
I think this change makes sense.
Perhaps Dominik has some idea why we didn't do that in the past?
I myself think this change makes sense, but let's wait for Dominik's feedback before going forward.

This revision is now accepted and ready to land.Mar 7 2020, 4:10 PM

I guess we can give this a try. As I understand, though, with this patch you will never be able to use e.g. a global zoom once you change the zoom of a view. This was different before this patch.

Which brings me to another point: e.g. zoom should simply zoom all documents, so zoom should not be done per view imho. In particular, with this patch you can end up with a different font size for each view, which is certainly not what a user wants.

Zoom is like all view stuff local, yes, I assume that is often not wanted.
But that is a orthogonal issue.
The same could be said for "dynamic word wrap", very seldom you want to set that for one view.
On the other side, for the global config, one has the settings dialog, same for "zoom", aka font size.

When it comes to Zoom, I would only expect it adapts to Global zoom settings again only once if I have reset my manual zooming to Default again.

Though. seems Zoom is not covered by that config setting object... please not the "not" in "are not yet covered" in my first comment :)

So, time to push now? Bit unsure how to take your last comments.

Yes, please push, thanks!

This revision was automatically updated to reflect the committed changes.

Seems this change has some sideeffects I did not experience when I played with this, but which are now uncovering as it hits people usinjg KF 5.70 :
config seems to write any settings, also the ones inherited from global defaults, as view-specific settings, and when reading them in again on session restart, they all become view-specific overrides, thus no longer influencable by global settings. Is that due to some other change elsewhere, or did I just completely miss this?

Possibly though this was mentioned before though:

I guess we can give this a try. As I understand, though, with this patch you will never be able to use e.g. a global zoom once you change the zoom of a view. This was different before this patch.

If so, I did not get the message, as I was focussed on the property itself, "zoom", which is not covered by the settings handled here.

So, what to do? I would argue that revert would be the best option for now, as the sideeffects are more grave than what this patch tried to solve.

I suggest to revert, and send a notification with the change to kde-distro-packager@kde.org to avoid that many users break their configuration.

kossebau added a comment.EditedMay 15 2020, 8:44 AM

I suggest to revert, and send a notification with the change to kde-distro-packager@kde.org to avoid that many users break their configuration.

Okay, doing now. Update: Revert now part of new release ktexteditor-5.70.1

Hmm, right, didn't think about that :(
Guess if we want to have this, we need to improve the read/writeConfig functions.