Commit 23d22131 authored by Cyril Rossi's avatar Cyril Rossi

KCM WorkspaceOptions use KCModuleData to highlight the module when settings have changed

CCBUG: 426775
parent 510b7a77
......@@ -4,6 +4,15 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kcm_workspace\")
########### next target ###############
set(kcm_workspace_SRCS
workspaceoptions.cpp
workspaceoptionsdata.cpp
)
kcmutils_generate_module_data(
kcm_workspace_SRCS
MODULE_DATA_HEADER workspaceoptionsdata.h
MODULE_DATA_CLASS_NAME WorkspaceOptionsData
SETTINGS_HEADERS workspaceoptions_plasmasettings.h workspaceoptions_kdeglobalssettings.h
SETTINGS_CLASSES WorkspaceOptionsPlasmaSettings WorkspaceOptionsGlobalsSettings
)
kconfig_add_kcfg_files(kcm_workspace_SRCS workspaceoptions_kdeglobalssettings.kcfgc GENERATE_MOC)
......@@ -14,6 +23,7 @@ add_library(kcm_workspace MODULE ${kcm_workspace_SRCS})
target_link_libraries(kcm_workspace
KF5::QuickAddons
KF5::I18n
KF5::KCMUtils
KF5::ConfigWidgets
KF5::Declarative
KF5::KDELibs4Support # kglobalsettings
......
......@@ -27,15 +27,15 @@
#include <QDBusMessage>
#include <QDBusConnection>
#include "workspaceoptionsdata.h"
#include "workspaceoptions_kdeglobalssettings.h"
#include "workspaceoptions_plasmasettings.h"
K_PLUGIN_FACTORY_WITH_JSON(KCMWorkspaceOptionsFactory, "kcm_workspace.json", registerPlugin<KCMWorkspaceOptions>();)
K_PLUGIN_FACTORY_WITH_JSON(KCMWorkspaceOptionsFactory, "kcm_workspace.json", registerPlugin<KCMWorkspaceOptions>(); registerPlugin<WorkspaceOptionsData>();)
KCMWorkspaceOptions::KCMWorkspaceOptions(QObject *parent, const QVariantList &args)
: KQuickAddons::ManagedConfigModule(parent, args)
, m_globalsSettings(new WorkspaceOptionsGlobalsSettings(this))
, m_plasmaSettings(new WorkspaceOptionsPlasmaSettings(this))
, m_data(new WorkspaceOptionsData(this))
{
qmlRegisterType<WorkspaceOptionsGlobalsSettings>();
qmlRegisterType<WorkspaceOptionsPlasmaSettings>();
......@@ -54,12 +54,12 @@ KCMWorkspaceOptions::KCMWorkspaceOptions(QObject *parent, const QVariantList &ar
WorkspaceOptionsGlobalsSettings *KCMWorkspaceOptions::globalsSettings() const
{
return m_globalsSettings;
return m_data->workspaceOptionsGlobalsSettings();
}
WorkspaceOptionsPlasmaSettings *KCMWorkspaceOptions::plasmaSettings() const
{
return m_plasmaSettings;
return m_data->workspaceOptionsPlasmaSettings();
}
void KCMWorkspaceOptions::save()
......
......@@ -22,6 +22,7 @@
#include <KQuickAddons/ManagedConfigModule>
class WorkspaceOptionsData;
class WorkspaceOptionsGlobalsSettings;
class WorkspaceOptionsPlasmaSettings;
......@@ -42,8 +43,7 @@ public Q_SLOTS:
void save() override;
private:
WorkspaceOptionsGlobalsSettings *m_globalsSettings;
WorkspaceOptionsPlasmaSettings *m_plasmaSettings;
WorkspaceOptionsData *m_data;
};
#endif // _KCM_WORKSPACEOPTIONS_H
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