diff --git a/src/util/urlhandler.cpp b/src/util/urlhandler.cpp --- a/src/util/urlhandler.cpp +++ b/src/util/urlhandler.cpp @@ -28,13 +28,24 @@ const QString helpcenter = QStandardPaths::findExecutable(QStringLiteral("khelpcenter")); if (helpcenter.isEmpty()) { + //if khelpcenter is not installed and it's a KDE application, use docs.kde.org if (QCoreApplication::organizationDomain() == QLatin1String("kde.org")) { - //if khelpcenter is not installed and it's a KDE application, use docs.kde.org - const QUrl httpUrl(QLatin1String("https://docs.kde.org/index.php?branch=stable5&language=")+QLocale().name()+QLatin1String("&application=") + - QCoreApplication::applicationName() + QStringLiteral("&path=") + url.path()); - QDesktopServices::openUrl(httpUrl); - } else + if (QCoreApplication::applicationName() == QLatin1String("systemsettings") + && url.path().startsWith(QLatin1String("/kcontrol"))) { + // special case for kcm modules + // e.g. "help:/kcontrol/fonts/index.html" >>> "&application=kcontorl/fonts" + const QUrl httpUrl(QStringLiteral("https://docs.kde.org/index.php?branch=stable5&language=") + + QLocale().name() + QLatin1String("&application=") + + url.path().remove(0, 1).remove(QLatin1String("/index.html"))); + QDesktopServices::openUrl(httpUrl); + } else { + const QUrl httpUrl(QLatin1String("https://docs.kde.org/index.php?branch=stable5&language=")+QLocale().name()+QLatin1String("&application=") + + QCoreApplication::applicationName() + QStringLiteral("&path=") + url.path()); + QDesktopServices::openUrl(httpUrl); + } + } else { QDesktopServices::openUrl(u); + } } else { QProcess::startDetached(helpcenter, QStringList(u.toString())); }