1 | /* |
---|---|
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org> |
4 | SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #include "kdedadaptor.h" |
10 | #include "kded.h" |
11 | #include <KSharedConfig> |
12 | #include <QCoreApplication> |
13 | #include <QDBusMessage> |
14 | |
15 | KdedAdaptor::KdedAdaptor(QObject *parent) |
16 | : QDBusAbstractAdaptor(parent) |
17 | { |
18 | } |
19 | |
20 | bool KdedAdaptor::isModuleAutoloaded(const QString &module) |
21 | { |
22 | return Kded::self()->isModuleAutoloaded(module); |
23 | } |
24 | |
25 | bool KdedAdaptor::isModuleLoadedOnDemand(const QString &module) |
26 | { |
27 | return Kded::self()->isModuleLoadedOnDemand(module); |
28 | } |
29 | |
30 | bool KdedAdaptor::loadModule(const QString &module) |
31 | { |
32 | return Kded::self()->loadModule(obj: module, onDemand: false) != nullptr; |
33 | } |
34 | |
35 | bool KdedAdaptor::unloadModule(const QString &module) |
36 | { |
37 | return Kded::self()->unloadModule(obj: module); |
38 | } |
39 | |
40 | void KdedAdaptor::registerWindowId(qlonglong windowId, const QDBusMessage &msg) |
41 | { |
42 | Kded::self()->registerWindowId(windowId, sender: msg.service()); |
43 | } |
44 | |
45 | void KdedAdaptor::setModuleAutoloading(const QString &module, bool autoload) |
46 | { |
47 | return Kded::self()->setModuleAutoloading(module, autoload); |
48 | } |
49 | void KdedAdaptor::unregisterWindowId(qlonglong windowId, const QDBusMessage &msg) |
50 | { |
51 | Kded::self()->unregisterWindowId(windowId, sender: msg.service()); |
52 | } |
53 | |
54 | QStringList KdedAdaptor::loadedModules() |
55 | { |
56 | return Kded::self()->loadedModules(); |
57 | } |
58 | |
59 | void KdedAdaptor::reconfigure() |
60 | { |
61 | KSharedConfig::openConfig(QStringLiteral("kded5rc"))->reparseConfiguration(); |
62 | Kded::self()->initModules(); |
63 | } |
64 | |
65 | void KdedAdaptor::quit() |
66 | { |
67 | QCoreApplication::instance()->quit(); |
68 | } |
69 | |
70 | #include "moc_kdedadaptor.cpp" |
71 |