<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/120595/">https://git.reviewboard.kde.org/r/120595/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On October 15th, 2014, 10:47 p.m. CEST, <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You're right that fromUserInput is wrong for relative paths (that should stay relative). fromUserInput turns them to http.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">However as the comment says, docPath could be either relative or absolute (at least both worked in KDE4). Your patch would break absolute urls.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">My suggestion:
  url = QUrl(QLatin1String("help:/")).resolved(QUrl(docPath));</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">(as documented in the KUrl(a,b) constructor, which this code was using in kde4)
(I might have written that docu later than when porting this code...)</p></pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ok thank you. When I read the KDE 4 code I didn't thought about absolute paths (Missinterpreted the documentation), so I supposed the comment in the KF5 branch was more like "I am not quite sure". The patch now contains your suggested change.</p></pre>
<br />










<p>- Simon</p>


<br />
<p>On October 15th, 2014, 1:09 p.m. CEST, Simon Wächter wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Frameworks and David Faure.</div>
<div>By Simon Wächter.</div>


<p style="color: grey;"><i>Updated Oct. 15, 2014, 1:09 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kconfigwidgets
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">During the port of KAppTemplate to KF5 I encountered a problem with the help invokation by hand - KAppTemplate has a help button in the main window/widget. These methods were used:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KDE4: KToolInvocation::invokeHelp("kapptemplate-init", "kapptemplate");
KF5: KHelpClient::invokeHelp("kapptemplate-init", "kapptemplate"); + Application name is set</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In KDE 4 it worked without a problem, but as soon it was ported to KF5 it stopped working. So I debugged the method and saw, that the URL for calling the help page has this (wrong) format:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">http://kapptemplate/index.html?anchor=kapptemplate-index</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">So, because the help address is an http-Url, I wrote a fix and the final URL now looks like this:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">help:/kapptemplate/index.html?anchor=kapptemplate-index</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This URL is KHelpCenter-valid and will call KHelpCenter. You can also take a look at the else part of that line: If no application is given, _appname is used and inserted in the correct url.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">As addition: As mentioned, the correct path might (is ?) not correct. But the problem is still, that if docPath has some content (In this case: "kapptemplate/index.html"), the url is interpreted as http one.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Testing was done under a project neon 5 system and with the current master branch of KConfigWidgets from git. Before installing the patched library, the help menu was not invokable from the KAppTemplate application. After installing the patching library it was.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also tested it with Kate help menu item from the "Settings" menu. It is also callable from "Settings" --> "Configure Kate" --> "Help" (Bottom left").</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/khelpclient.cpp <span style="color: grey">(09a3167)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/120595/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>








  </div>
 </body>
</html>