KCMUtils

pluginpage.cpp
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2003 Matthias Kretz <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-only
6 */
7 
8 #include "ksettings/pluginpage.h"
9 #include "kpluginselector.h"
10 #include "ksettings/dispatcher.h"
11 #include <KAboutData>
12 
13 namespace KSettings
14 {
15 #if KCMUTILS_BUILD_DEPRECATED_SINCE(5, 76)
16 
17 class PluginPagePrivate
18 {
19 public:
20  PluginPagePrivate()
21  {
22  }
23 
24  KPluginSelector *m_pluginSelector = nullptr;
25  void _k_reparseConfiguration(const QByteArray &a);
26 };
27 
28 PluginPage::PluginPage(const KAboutData *aboutData, QWidget *parent, const QVariantList &args)
29  : KCModule(aboutData, parent, args)
30  , d_ptr(new PluginPagePrivate)
31 {
32  Q_D(PluginPage);
33  d->m_pluginSelector = new KPluginSelector(this);
34  connect(d->m_pluginSelector, &KPluginSelector::changed, this, &KCModule::changed);
35  connect(d->m_pluginSelector, &KPluginSelector::configCommitted, this, [d](const QByteArray &componentName) {
36  d->_k_reparseConfiguration(componentName);
37  });
38 }
39 
40 void PluginPagePrivate::_k_reparseConfiguration(const QByteArray &a)
41 {
43 }
44 
45 PluginPage::~PluginPage()
46 {
47  delete d_ptr;
48 }
49 
51 {
52  return d_ptr->m_pluginSelector;
53 }
54 
56 {
57  d_ptr->m_pluginSelector->load();
58 }
59 
61 {
62  d_ptr->m_pluginSelector->save();
63 }
64 
65 void PluginPage::defaults()
66 {
67  d_ptr->m_pluginSelector->defaults();
68 }
69 
70 #endif
71 
72 } // namespace
73 
74 #include "moc_pluginpage.cpp"
void load() override
Load the state of the plugins (selected or not) from the KPluginInfo objects.
Definition: pluginpage.cpp:55
void changed(bool hasChanged)
Tells you whether the configuration is changed or not.
A widget to select what plugins to load and configure the plugins.
void reparseConfiguration(const QString &componentName)
Call this function when the configuration belonging to the associated componentData name has changed.
Definition: dispatcher.cpp:50
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
PluginPage(const KAboutData *aboutData, QWidget *parent=nullptr, const QVariantList &args=QVariantList())
Standard KCModule constructor.
Definition: pluginpage.cpp:28
void save() override
Save the state of the plugins to KConfig objects.
Definition: pluginpage.cpp:60
void configCommitted(const QByteArray &componentName)
Emitted after the config of an embedded KCM has been saved.
KPluginSelector * pluginSelector()
Definition: pluginpage.cpp:50
QString fromLatin1(const char *str, int size)
A collection of classes to create configuration dialogs that work over component boundaries.
Definition: dialog.cpp:35
Convenience KCModule for creating a plugins config page.
Definition: pluginpage.h:61
void changed()
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri May 27 2022 03:51:38 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.