1 | /* This file is part of the KDE libraries |
2 | * Copyright (C) 1999 David Faure <faure@kde.org> |
3 | * Copyright (C) 2000 Waldo Bastian <bastian@kde.org> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Library General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Library General Public License |
16 | * along with this library; see the file COPYING.LIB. If not, write to |
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | * Boston, MA 02110-1301, USA. |
19 | **/ |
20 | |
21 | #include "kdedadaptor.h" |
22 | #include "kded.h" |
23 | #include <kglobal.h> |
24 | #include <kconfig.h> |
25 | #include <QCoreApplication> |
26 | |
27 | KdedAdaptor::KdedAdaptor(QObject *parent) |
28 | : QDBusAbstractAdaptor(parent) |
29 | { |
30 | } |
31 | |
32 | bool KdedAdaptor::isModuleAutoloaded(const QString &module) |
33 | { |
34 | return Kded::self()->isModuleAutoloaded(module); |
35 | } |
36 | |
37 | bool KdedAdaptor::isModuleLoadedOnDemand(const QString &module) |
38 | { |
39 | return Kded::self()->isModuleLoadedOnDemand(module); |
40 | } |
41 | |
42 | bool KdedAdaptor::loadModule(const QString &module) |
43 | { |
44 | return Kded::self()->loadModule(module, false) != 0; |
45 | } |
46 | |
47 | bool KdedAdaptor::unloadModule(const QString &module) |
48 | { |
49 | return Kded::self()->unloadModule(module); |
50 | } |
51 | |
52 | void KdedAdaptor::registerWindowId(qlonglong windowId, const QDBusMessage &msg) |
53 | { |
54 | Kded::self()->registerWindowId(windowId, msg.service()); |
55 | } |
56 | |
57 | void KdedAdaptor::setModuleAutoloading(const QString &module, bool autoload) |
58 | { |
59 | return Kded::self()->setModuleAutoloading(module, autoload); |
60 | } |
61 | void KdedAdaptor::unregisterWindowId(qlonglong windowId, const QDBusMessage &msg) |
62 | { |
63 | Kded::self()->unregisterWindowId(windowId, msg.service()); |
64 | } |
65 | |
66 | QStringList KdedAdaptor::loadedModules() |
67 | { |
68 | return Kded::self()->loadedModules(); |
69 | } |
70 | |
71 | void KdedAdaptor::reconfigure() |
72 | { |
73 | KGlobal::config()->reparseConfiguration(); |
74 | Kded::self()->initModules(); |
75 | Kded::self()->loadSecondPhase(); |
76 | } |
77 | |
78 | void KdedAdaptor::loadSecondPhase() |
79 | { |
80 | Kded::self()->loadSecondPhase(); |
81 | } |
82 | |
83 | void KdedAdaptor::quit() |
84 | { |
85 | QCoreApplication::instance()->quit(); |
86 | } |
87 | |
88 | #include "kdedadaptor.moc" |
89 | |