Changeset View
Changeset View
Standalone View
Standalone View
src/qmlcontrols/kquickcontrolsaddons/kcmshell.cpp
Show All 16 Lines | |||||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "kcmshell.h" | 20 | #include "kcmshell.h" | ||
21 | 21 | | |||
22 | #include <QProcess> | 22 | #include <QProcess> | ||
23 | 23 | | |||
24 | #include <KAuthorized> | 24 | #include <KAuthorized> | ||
25 | #include <KService> | ||||
25 | 26 | | |||
26 | KCMShell::KCMShell(QObject *parent) : QObject(parent) | 27 | KCMShell::KCMShell(QObject *parent) : QObject(parent) | ||
27 | { | 28 | { | ||
28 | 29 | | |||
29 | } | 30 | } | ||
30 | 31 | | |||
31 | KCMShell::~KCMShell() | 32 | KCMShell::~KCMShell() | ||
32 | { | 33 | { | ||
33 | 34 | | |||
34 | } | 35 | } | ||
35 | 36 | | |||
36 | void KCMShell::open(const QStringList &names) const | 37 | void KCMShell::open(const QStringList &names) const | ||
37 | { | 38 | { | ||
38 | QProcess::startDetached(QStringLiteral("kcmshell5"), names); | 39 | QProcess::startDetached(QStringLiteral("kcmshell5"), names); | ||
39 | } | 40 | } | ||
40 | 41 | | |||
42 | void KCMShell::openSystemSettings(const QString &name) const | ||||
43 | { | ||||
44 | auto service = KService::serviceByDesktopName(QStringLiteral("systemsettings")); | ||||
45 | if (service) { | ||||
46 | QProcess::startDetached(QStringLiteral("systemsettings5"), QStringList(name)); | ||||
47 | } else { | ||||
48 | QProcess::startDetached(QStringLiteral("kcmshell5"), QStringList(name)); | ||||
49 | } | ||||
50 | } | ||||
51 | | ||||
52 | void KCMShell::openInfoCenter(const QString &name) const | ||||
53 | { | ||||
54 | auto service = KService::serviceByDesktopName(QStringLiteral("systemsettings")); | ||||
55 | if (service) { | ||||
56 | QProcess::startDetached(QStringLiteral("kinfocenter"), QStringList(name)); | ||||
57 | } else { | ||||
58 | QProcess::startDetached(QStringLiteral("kcmshell5"), QStringList(name)); | ||||
59 | } | ||||
60 | } | ||||
61 | | ||||
41 | QStringList KCMShell::authorize(const QStringList &menuIds) const | 62 | QStringList KCMShell::authorize(const QStringList &menuIds) const | ||
42 | { | 63 | { | ||
43 | return KAuthorized::authorizeControlModules(menuIds); | 64 | return KAuthorized::authorizeControlModules(menuIds); | ||
44 | } | 65 | } |