D7580: Support loading by stream and restoring state on reload

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Mon Aug 28 00:33:38 UTC 2017


kossebau created this revision.

REVISION SUMMARY
  The KTextEditor preview plugin* repeatedly feeds new
  versions to the same kpart instance, to allow instant
  preview of changes. To avoid stressing of the filesystem
  the stream API of the kpart is used if available.
  *https://frinring.wordpress.com/2017/08/21/look-what-you-have-donewwdo/
  
  This patch adds support for the stream API.
  Additionally it remembers the view state on closing an url,
  and if the same url is load again, the view state is restored.
  The latter allows continuous display of the same, but
  updated file as e.g. happening with the preview plugin.
  
  Open questions:
  a) use of the streaming API matching intentions?
  b) Restoring of view state overlaps with support in browser history,
  
    for which there is the KParts::OpenUrlArguments property of ReadOnlyPart.
    That one only supports x/y offset, so how would zoom and other custom
    state properties be save and retrieved again, if they should?
  
  This patch should help to solve this questions in general, so it is
  known what to do for other kparts.

TEST PLAN
  Editing SVG files in Kate/Kdevelop using the preview plugin* will
  no longer reset the offset to 0,0 each time the view is updated on
  changes, also is the filesystem no longer used on updates.
  
  - kde:scratch/kossebau/ktexteditorpreviewplugin

REPOSITORY
  R383 SVGPart

BRANCH
  supportstreamandreload

REVISION DETAIL
  https://phabricator.kde.org/D7580

AFFECTED FILES
  svgpart.cpp
  svgpart.h

To: kossebau, #frameworks, dfaure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170828/c644bf73/attachment.html>


More information about the Kde-frameworks-devel mailing list