kinfocenter: use KToolInvocation::invokeHelp() instead of attempting to start khelpcenter

khelpcenter is no longer maintained

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-03 15:46:52 +03:00
parent 5dea205ad7
commit b048083425
3 changed files with 5 additions and 11 deletions

View file

@ -234,11 +234,7 @@ void KInfoCenter::resetCondition()
void KInfoCenter::helpClickedSlot() void KInfoCenter::helpClickedSlot()
{ {
// Nicked from Ben, could not use KToolInvocation due to docpath. KToolInvocation::invokeHelp(QString(), m_contain->serviceName());
QString docPath = m_contain->helpPath();
KUrl url( KUrl("help:/"), docPath );
QProcess::startDetached("khelpcenter", QStringList() << url.url());
} }
void KInfoCenter::exportClickedSlot() void KInfoCenter::exportClickedSlot()

View file

@ -117,10 +117,10 @@ void KcmContainer::setKcmTitle(const KCModuleInfo &info)
m_titleLabel->setText(i18n("%1 ( %2 )",kcmTitle,kcmComment)); m_titleLabel->setText(i18n("%1 ( %2 )",kcmTitle,kcmComment));
} }
QString KcmContainer::helpPath() const QString KcmContainer::serviceName() const
{ {
if(m_mod == NULL) return QString(); if(m_mod == NULL) return QString();
return m_modInfo.docPath(); return m_modInfo.fileName().replace(QLatin1String(".desktop"), QString());
} }
KCModule::Buttons KcmContainer::buttons() const KCModule::Buttons KcmContainer::buttons() const

View file

@ -65,11 +65,9 @@ class KcmContainer : public QScrollArea
void setKcmTopEdge(int y); void setKcmTopEdge(int y);
/** /**
* Get currently selected KCMs document path * Get currently selected KCMs service name
* for .desktop
* X-KDE-DocPath
*/ */
QString helpPath() const; QString serviceName() const;
/** /**
* Get currently selected KCMs * Get currently selected KCMs