<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7580" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D7580#144414" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D7580#144414</a>, <a href="https://phabricator.kde.org/p/dfaure/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@dfaure</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D7580#142971" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D7580#142971</a>, <a href="https://phabricator.kde.org/p/kossebau/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@kossebau</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>"how would zoom and other custom state properties be save and retrieved again"  -> using BrowserExtension's saveState/restoreState as usual, no? I'm not 100% sure about the interaction with streaming, but normally that happens after opening the url anyway, so it should be unrelated.</p></blockquote>

<p>Oh, somehow missed those methods. Possibly was blinded by KParts::OpenUrlArguments::xOffset()/yOffset() and since then assumed that state restoring was supposed to be done only via those arguments.</p></div>
</blockquote>

<p>That's just the default implementation of BE::restoreState(), which loads url+offsets and calls setArguments before openUrl. But this is virtual, so more can be done.</p></div>
</blockquote>

<p>Okay, matches the picture I have got meanwhile once I read more through the API dox and code (history) of Konqeror, KHTML and KParts.</p>

<p>Though sadly there is a bummer with <a href="https://api.kde.org/frameworks/kparts/html/classKParts_1_1BrowserExtension.html#aa079a1969335549d2c20a3ce60ce4dfa" class="remarkup-link" target="_blank" rel="noreferrer">void BrowserExtension::restoreState(QDataStream& stream)</a>:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">Used by the browser to restore the view in the state it was when we left it.
If you saved additional properties, reimplement it but don't forget to call the parent method (probably first).</pre></div>

<p>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.</p>

<p>Seems I have to sit down and draft some generic stream usage test cases and derive from that some proposal for a KParts API extension of some kind. No resources for that right now, might only do later this year. So no session support or view state memory in the KTextEditor Preview plugin then for now, too bad, would have been nice to have.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>And only enable/activate the browser-integration specific parts if the part is created with "Browser/View"?</p></blockquote>

<p>No, I wouldn't recommend that. Create the extension always, let the app decide whether to use it.</p></blockquote>

<p>Okay, thanks for clarification.</p>

<p>Will complete this patch next to at least support classic browser view state restoring as via BE::restoreState().</p>

<p>BTW: can you tell if Falkon will/does support kparts?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R383 SVGPart</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7580" rel="noreferrer">https://phabricator.kde.org/D7580</a></div></div><br /><div><strong>To: </strong>kossebau, Frameworks, dfaure<br /></div>