Review Request 120595: Build correct QUrl path when KHelpClient::invokeHelp is called

David Faure faure at kde.org
Wed Oct 15 20:47:08 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120595/#review68515
-----------------------------------------------------------


You're right that fromUserInput is wrong for relative paths (that should stay relative). fromUserInput turns them to http.

However as the comment says, docPath could be either relative or absolute (at least both worked in KDE4). Your patch would break absolute urls.

My suggestion:
  url = QUrl(QLatin1String("help:/")).resolved(QUrl(docPath));
  
(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...)

- David Faure


On Oct. 15, 2014, 11:09 a.m., Simon Wächter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120595/
> -----------------------------------------------------------
> 
> (Updated Oct. 15, 2014, 11:09 a.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kconfigwidgets
> 
> 
> Description
> -------
> 
> 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:
> 
> KDE4: KToolInvocation::invokeHelp("kapptemplate-init", "kapptemplate");
> KF5: KHelpClient::invokeHelp("kapptemplate-init", "kapptemplate"); + Application name is set
> 
> 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:
> 
> http://kapptemplate/index.html?anchor=kapptemplate-index
> 
> So, because the help address is an http-Url, I wrote a fix and the final URL now looks like this:
> 
> help:/kapptemplate/index.html?anchor=kapptemplate-index
> 
> 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.
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   src/khelpclient.cpp 09a3167 
> 
> Diff: https://git.reviewboard.kde.org/r/120595/diff/
> 
> 
> Testing
> -------
> 
> 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.
> 
> Also tested it with Kate help menu item from the "Settings" menu. It is also callable from "Settings" --> "Configure Kate" --> "Help" (Bottom left").
> 
> 
> Thanks,
> 
> Simon Wächter
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141015/80123bc3/attachment.html>


More information about the Kde-frameworks-devel mailing list