File indexing completed on 2024-07-14 03:52:52

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
0004     SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "kdedadaptor.h"
0010 #include "kded.h"
0011 #include <KSharedConfig>
0012 #include <QCoreApplication>
0013 #include <QDBusMessage>
0014 
0015 KdedAdaptor::KdedAdaptor(QObject *parent)
0016     : QDBusAbstractAdaptor(parent)
0017 {
0018 }
0019 
0020 bool KdedAdaptor::isModuleAutoloaded(const QString &module)
0021 {
0022     return Kded::self()->isModuleAutoloaded(module);
0023 }
0024 
0025 bool KdedAdaptor::isModuleLoadedOnDemand(const QString &module)
0026 {
0027     return Kded::self()->isModuleLoadedOnDemand(module);
0028 }
0029 
0030 bool KdedAdaptor::loadModule(const QString &module)
0031 {
0032     return Kded::self()->loadModule(module, false) != nullptr;
0033 }
0034 
0035 bool KdedAdaptor::unloadModule(const QString &module)
0036 {
0037     return Kded::self()->unloadModule(module);
0038 }
0039 
0040 void KdedAdaptor::registerWindowId(qlonglong windowId, const QDBusMessage &msg)
0041 {
0042     Kded::self()->registerWindowId(windowId, msg.service());
0043 }
0044 
0045 void KdedAdaptor::setModuleAutoloading(const QString &module, bool autoload)
0046 {
0047     return Kded::self()->setModuleAutoloading(module, autoload);
0048 }
0049 void KdedAdaptor::unregisterWindowId(qlonglong windowId, const QDBusMessage &msg)
0050 {
0051     Kded::self()->unregisterWindowId(windowId, msg.service());
0052 }
0053 
0054 QStringList KdedAdaptor::loadedModules()
0055 {
0056     return Kded::self()->loadedModules();
0057 }
0058 
0059 void KdedAdaptor::reconfigure()
0060 {
0061     KSharedConfig::openConfig(QStringLiteral("kded5rc"))->reparseConfiguration();
0062     Kded::self()->initModules();
0063 }
0064 
0065 void KdedAdaptor::quit()
0066 {
0067     QCoreApplication::instance()->quit();
0068 }
0069 
0070 #include "moc_kdedadaptor.cpp"