Commit 30a78282 authored by Laurent Montel's avatar Laurent Montel 😁

Create own invokeHelp as kf5 invokehelp is too limited

we can't specify a html file we will use just html file defined in desktop file
it's limited when we have several file as in kmail
parent e8bd5952
......@@ -21,7 +21,7 @@ include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(ECMInstallIcons)
set(PIM_VERSION "5.2.80")
set(PIM_VERSION "5.2.81")
set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.2.80")
......
......@@ -41,6 +41,7 @@
#include "imapresourcesettings.h"
#include <QFileDialog>
#include <QDesktopServices>
#include <KMessageBox>
#include <KLocalizedString>
......@@ -147,3 +148,18 @@ QString PimCommon::Util::indexerServiceName()
return basename;
}
}
void PimCommon::Util::invokeHelp(const QString &docfile, const QString &anchor)
{
if (!docfile.isEmpty()) {
QUrl url;
url = QUrl(QStringLiteral("help:/")).resolved(QUrl(docfile));
if (!anchor.isEmpty()) {
QUrlQuery query(url);
query.addQueryItem(QStringLiteral("anchor"), anchor);
url.setQuery(query);
}
// launch khelpcenter, or a browser for URIs not handled by khelpcenter
QDesktopServices::openUrl(url);
}
}
......@@ -65,6 +65,7 @@ PIMCOMMON_EXPORT bool saveToFile(const QString &filename, const QString &text);
PIMCOMMON_EXPORT QString loadToFile(const QString &filter, QWidget *parent, const QUrl &url = QUrl(), const QString &caption = QString());
PIMCOMMON_EXPORT bool isImapResource(const QString &identifier);
PIMCOMMON_EXPORT bool isImapFolder(const Akonadi::Collection &col, bool &isOnline);
PIMCOMMON_EXPORT void invokeHelp(const QString &docfile, const QString &anchor = QString());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment