Bug 405651 - kcmultidialog/kcmshell5 help buttons broken; depend on khelpcenter
Summary: kcmultidialog/kcmshell5 help buttons broken; depend on khelpcenter
Status: REPORTED
Alias: None
Product: frameworks-kcmutils
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-19 14:44 UTC by Harald Sitter
Modified: 2021-06-10 11:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2019-03-19 14:44:32 UTC
khelpcenter lives in applications and as such cannot be expected to be available for frameworks. yet kcmultidialog wants to always launch it for documentation paths which aren't absolutely specifying a scheme.

e.g. kinfocenter's memory module sets

X-DocPath=kinfocenter/index.html#kcm_memory

which kcmmultidialog will QUrl as 'help:/kinfocenter/index.html#kcm_memory' and as a help:/ URL then *always* runs through khelpcenter, which may not be installed (and the help button will be enabled but do nothing because of this).

Kcmmultidialog probably should run all urls through QDesktopServices, which should have an url handler installed by kguiaddons (see UrlHandler.cpp in kguiaddons). IOW: drop the explicitly call to khelpcenter

void KCMultiDialog::slotHelpClicked()
{
...

    const QUrl docUrl = QUrl(QStringLiteral("help:/")).resolved(QUrl(docPath)); // same code as in KHelpClient::invokeHelp
    const QString docUrlScheme = docUrl.scheme();
    if (docUrlScheme == QLatin1String("help") || docUrlScheme == QLatin1String("man") || docUrlScheme == QLatin1String("info")) {
        QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << docUrl.toString());
    } else {
        QDesktopServices::openUrl(docUrl);
    }
}
Comment 1 Ahmad Samir 2021-06-10 11:11:00 UTC
For help:/ urls, I agree.

For man:/ and info:/ we'll have to add handlers because currently UrlHandler only works with help:/. For man:/ and info:/ urls there is KHelpCenter, and Konqueror o/

The plot thickens.