Verified Commit 7769b79e authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

ConfigureDialog: Use KPluginMetaData to load KCMs

parent b17e8c23
Pipeline #66197 passed with stage
in 24 minutes and 18 seconds
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
#include "kmkernel.h" #include "kmkernel.h"
#include "settings/kmailsettings.h" #include "settings/kmailsettings.h"
#include <kcmutils_version.h>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QPushButton> #include <QPushButton>
ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal) ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal)
...@@ -24,12 +28,15 @@ ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal) ...@@ -24,12 +28,15 @@ ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal)
setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Help | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Cancel | QDialogButtonBox::Apply setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Help | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Cancel | QDialogButtonBox::Apply
| QDialogButtonBox::Reset); | QDialogButtonBox::Reset);
setModal(modal); setModal(modal);
addModule(QStringLiteral("kmail_config_accounts"));
addModule(QStringLiteral("kmail_config_appearance")); const QVector<KPluginMetaData> availablePlugins = KPluginLoader::findPlugins(QStringLiteral("pim/kcms/kmail"));
addModule(QStringLiteral("kmail_config_composer")); for (const KPluginMetaData &metaData : availablePlugins) {
addModule(QStringLiteral("kmail_config_security")); #if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
addModule(QStringLiteral("kmail_config_misc")); addModule(metaData);
addModule(QStringLiteral("kmail_config_plugins")); #else
addModule(metaData.pluginId());
#endif
}
connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &ConfigureDialog::slotOk); connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &ConfigureDialog::slotOk);
connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &ConfigureDialog::slotApply); connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &ConfigureDialog::slotApply);
......
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