Commit cc77e4ff authored by Cyril Rossi's avatar Cyril Rossi

KCM Background Services : highlight non default settings

parent cce7f619
......@@ -5,6 +5,7 @@ set(kcm_kded_SRCS
kcmkded.cpp
modulesmodel.cpp
filterproxymodel.cpp
kdedconfigdata.cpp
)
qt5_add_dbus_interface(kcm_kded_SRCS ${KDED_DBUS_INTERFACE} kded_interface)
......@@ -18,7 +19,7 @@ add_library(kcm_kded MODULE ${kcm_kded_SRCS})
kcoreaddons_desktop_to_json(kcm_kded "kcmkded.desktop")
target_link_libraries(kcm_kded KF5::QuickAddons KF5::Service KF5::I18n Qt5::DBus)
target_link_libraries(kcm_kded KF5::QuickAddons KF5::Service KF5::I18n KF5::KCMUtils Qt5::DBus)
install(TARGETS kcm_kded DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms )
......
......@@ -40,8 +40,9 @@
#include "filterproxymodel.h"
#include "kded_interface.h"
#include "kdedconfigdata.h"
K_PLUGIN_FACTORY_WITH_JSON(KCMStyleFactory, "kcmkded.json", registerPlugin<KDEDConfig>();)
K_PLUGIN_FACTORY_WITH_JSON(KCMStyleFactory, "kcmkded.json", registerPlugin<KDEDConfig>(); registerPlugin<KDEDConfigData>();)
static const QString s_kdedServiceName = QStringLiteral("org.kde.kded5");
......
/* This file is part of the KDE project
Copyright (C) 2021 Cyril Rossi <cyril.rossi@enioka.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kdedconfigdata.h"
#include <KConfig>
#include <KConfigGroup>
KDEDConfigData::KDEDConfigData(QObject *parent, const QVariantList &args)
: KCModuleData(parent, args)
{
}
bool KDEDConfigData::isDefaults() const
{
KConfig kdedrc(QStringLiteral("kded5rc"), KConfig::NoGlobals);
const QStringList groupList = kdedrc.groupList();
for (auto &groupName : groupList) {
if (groupName.startsWith(QStringLiteral("Module-"))) {
KConfigGroup cg(&kdedrc, groupName);
if (!cg.readEntry(QStringLiteral("autoload"), true)) {
return false;
}
}
}
return true;
}
/* This file is part of the KDE project
Copyright (C) 2021 Cyril Rossi <cyril.rossi@enioka.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDEDCONFIGDATA_H
#define KDEDCONFIGDATA_H
#include <QObject>
#include <KCModuleData>
class KDEDConfigData : public KCModuleData
{
Q_OBJECT
public:
KDEDConfigData(QObject *parent = nullptr, const QVariantList &args = QVariantList());
bool isDefaults() const override;
};
#endif // KDEDCONFIGDATA_H
......@@ -24,7 +24,7 @@ import QtQuick.Controls 2.3 as QtControls
import QtQml 2.15
import org.kde.kirigami 2.10 as Kirigami
import org.kde.kcm 1.2 as KCM
import org.kde.kcm 1.5 as KCM
import org.kde.private.kcms.style 1.0 as Private
KCM.ScrollViewKCM {
......@@ -194,6 +194,10 @@ KCM.ScrollViewKCM {
QtControls.ToolTip {
text: delegate.Accessible.description
}
KCM.SettingHighlighter {
highlight: !model.autoloadEnabled
}
}
ColumnLayout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment