File indexing completed on 2024-05-12 17:07:11

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2021 Cyril Rossi <cyril.rossi@enioka.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "kdedconfigdata.h"
0009 
0010 #include <KConfig>
0011 #include <KConfigGroup>
0012 
0013 KDEDConfigData::KDEDConfigData(QObject *parent, const QVariantList &args)
0014     : KCModuleData(parent, args)
0015 {
0016 }
0017 
0018 bool KDEDConfigData::isDefaults() const
0019 {
0020     KConfig kdedrc(QStringLiteral("kded5rc"), KConfig::NoGlobals);
0021     const QStringList groupList = kdedrc.groupList();
0022     for (auto &groupName : groupList) {
0023         if (groupName.startsWith(QStringLiteral("Module-"))) {
0024             KConfigGroup cg(&kdedrc, groupName);
0025             if (!cg.readEntry(QStringLiteral("autoload"), true)) {
0026                 return false;
0027             }
0028         }
0029     }
0030 
0031     return true;
0032 }