Commit e003e866 authored by Marco Martin's avatar Marco Martin

update kcm statistics in kcmshell too

Summary:
also when opening modules with kcmshell (used a lot with krunner)
the statistics need to be updated to keep the list on systemsettings startup
up to date and have complete usage data of kcm modules

Test Plan:
opened systemsettings and a module with kcmsell, the list gets updated
on the fly

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6112
parent 492df95c
......@@ -44,6 +44,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
KIO
Service
WindowSystem
Activities
OPTIONAL_COMPONENTS
Su
QUIET
......
......@@ -10,6 +10,7 @@ target_link_libraries(kdeinit_kcmshell5
KF5::KCMUtils
KF5::I18n
KF5::WindowSystem
KF5::Activities
)
install(TARGETS kdeinit_kcmshell5 ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -33,12 +33,14 @@
#include <KCModuleInfo>
#include <KCMultiDialog>
#include <KCModuleProxy>
#include <QDebug>
#include <KLocalizedString>
#include <KServiceTypeTrader>
#include <KStartupInfo>
#include <QIcon>
#include <KActivities/ResourceInstance>
#include <QIcon>
#include <QCommandLineParser>
#include <QCommandLineOption>
......@@ -122,6 +124,15 @@ KCMShellMultiDialog::KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidg
setModal(false);
QDBusConnection::sessionBus().registerObject("/KCModule/dialog", this, QDBusConnection::ExportScriptableSlots);
connect(this, &KCMShellMultiDialog::currentPageChanged,
this, [this](KPageWidgetItem *newPage,KPageWidgetItem *oldPage) {
KCModuleProxy *activeModule = qobject_cast<KCModuleProxy *>(newPage->widget());
if (activeModule) {
KActivities::ResourceInstance::notifyAccessed(QUrl("kcm:" + activeModule->moduleInfo().service()->storageId()),
"org.kde.systemsettings");
}
});
}
void KCMShellMultiDialog::activate(const QByteArray& asn_id)
......
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