D7580: Support loading by stream and restoring state on reload

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Tue Sep 12 15:21:53 UTC 2017


kossebau added a comment.


  In https://phabricator.kde.org/D7580#144557, @dfaure wrote:
  
  > In https://phabricator.kde.org/D7580#144518, @kossebau wrote:
  >
  > > When I read this initially, I guessed this method is just about the view state. But is also bound to data-pulling by the kpart, given that the default implementation explicitely calls openUrl() with the url stored in the datastream. Which might make sense for simple-to-use API with the non-stream use cases. But leaves out the stream-based data-pushing usage.
  >
  >
  > It does indeed. Two incompatible features...
  >
  > I think all we need is for the part to remember that it opened the URL via the stream api, and add that to the data saved by saveState(). Then in restoreState() we can skip openUrl() when that bool is true. It'll be up to the caller to redo the openStream/writeStream/closeStream sequence.
  
  
  Might work, yes. One issue: changing the content layout of the state QDataStream is currently not protected by any versioning, so existing stored history (like from session restore) would be parsed wrongly if suddenly the base implementation of restore also tries to extract such a bool? Might need some handling, though not sure if serious data would be lost.
  
  As said, myself might look into improving this only later this year, so if you (or someone else) feels inspired to play with this, please go ahead already.
  
  >>   BTW: can you tell if Falkon will/does support kparts?
  > 
  > It doesn't, and I don't think it will, but you can try to convince David Rosca ;)
  
  Too bad. Having a cross-media/format navigator like with Konqueror had been one of the things that attracted me to KDE.
  Okay, so nothing where I should extend my testing coverage to.
  
  With the latest update then this patch would represent the blue-print for KParts plugins as I see it when it comes to supporting both state restoring and support for streams, at least for what is possible currently with the existing KParts API.
  
  Any patterns which you see running against the ideas of the API? Or can this patch be applied as is, and be pointed to as template?

REPOSITORY
  R383 SVGPart

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

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


More information about the Kde-frameworks-devel mailing list