[ConfigView] Honor KIOSK Control Module restrictions
Differential Revision: https://phabricator.kde.org/D4679
This commit is contained in:
parent
13054c0473
commit
1934475e48
@ -32,6 +32,7 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
|
|
||||||
|
#include <KAuthorized>
|
||||||
#include <klocalizedstring.h>
|
#include <klocalizedstring.h>
|
||||||
#include <kdeclarative/kdeclarative.h>
|
#include <kdeclarative/kdeclarative.h>
|
||||||
#include <packageurlinterceptor.h>
|
#include <packageurlinterceptor.h>
|
||||||
@ -141,7 +142,15 @@ void ConfigViewPrivate::init()
|
|||||||
delete object;
|
delete object;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList kcms = KPluginMetaData::readStringList(applet.data()->pluginMetaData().rawData(), QStringLiteral("X-Plasma-ConfigPlugins"));
|
QStringList kcms = KPluginMetaData::readStringList(applet.data()->pluginMetaData().rawData(), QStringLiteral("X-Plasma-ConfigPlugins"));
|
||||||
|
|
||||||
|
// filter out non-authorized KCMs
|
||||||
|
// KAuthorized expects KCMs with .desktop suffix, so we can't just pass everything
|
||||||
|
// to KAuthorized::authorizeControlModules verbatim
|
||||||
|
kcms.erase(std::remove_if(kcms.begin(), kcms.end(), [](const QString &kcm) {
|
||||||
|
return !KAuthorized::authorizeControlModule(kcm + QLatin1String(".desktop"));
|
||||||
|
}), kcms.end());
|
||||||
|
|
||||||
if (!kcms.isEmpty()) {
|
if (!kcms.isEmpty()) {
|
||||||
if (!configModel) {
|
if (!configModel) {
|
||||||
configModel = new ConfigModel(q);
|
configModel = new ConfigModel(q);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user