21 if (_appname.isEmpty()) {
22 appname = QCoreApplication::instance()->applicationName();
36 const QStringList desktopDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
37 Q_FOREACH (
const QString &dir, desktopDirs) {
38 QDirIterator it(dir,
QStringList() << appname + QLatin1String(
".desktop"), QDir::NoFilter, QDirIterator::Subdirectories);
39 while (it.hasNext()) {
40 const QString desktopPath(it.next());
41 KDesktopFile desktopFile(desktopPath);
42 docPath = desktopFile.readDocPath();
52 if (!docPath.isEmpty()) {
53 url = QUrl(QLatin1String(
"help:/")).resolved(QUrl(docPath));
55 url = QUrl(QString::fromLatin1(
"help:/%1/index.html").arg(appname));
58 if (!anchor.isEmpty()) {
60 query.addQueryItem(QString::fromLatin1(
"anchor"), anchor);
65 QDesktopServices::openUrl(url);