Properly save state of KTextEditor Views
ClosedPublic

Authored by kfunk on Mar 23 2018, 9:16 AM.

Details

Summary

Call the KTextEditor::View methods for reading & storing the state:

  • KTextEditor::View::readSessionConfig()
  • KTextEditor::View::writeSessionConfig()

Remove our implementation of storing the state of ...:

  • Cursor
  • Selection

By using the KTextEditor methods we do save the states of ...:

  • Cursor
  • Dynamic Word Wrap
  • Text Folding nodes
  • ...

Thus, with this patch the storing & retrieving of the selection state is
lost. To be honest, I don't see that as a super useful feature anyway.

FIXED-IN: 5.3.0
BUG: 385919

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kfunk created this revision.Mar 23 2018, 9:16 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptMar 23 2018, 9:16 AM
kfunk requested review of this revision.Mar 23 2018, 9:16 AM
mwolff added a subscriber: mwolff.Mar 23 2018, 10:22 AM
mwolff added inline comments.
kdevplatform/shell/textdocument.cpp
159

what about this code?

169

dito

That's just for reading & storing the state of the *document* (i.e. indentation settings, etc. pp.). My patch adds support for reading & storing the state of the *view*, too.

mwolff accepted this revision.Mar 23 2018, 3:14 PM

doh :)

some minor nits, otherwise lgtm. please cleanup and then feel free to push

also, I'd prefer if we don't leak the implementation detail of the apparently useless QSet of flags, since it's always going to be empty anyways

kdevplatform/shell/textdocument.h
114 ↗(On Diff #30286)

remove spaces before &, also below

kdevplatform/sublime/view.h
24 ↗(On Diff #30286)

qlist include shouldn't be required?

This revision is now accepted and ready to land.Mar 23 2018, 3:14 PM
This revision was automatically updated to reflect the committed changes.