Verified Commit 809df6cb authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

Use KPluginMetaData to load KCMs in KCMultiDialog

Task: https://phabricator.kde.org/T14501
parent 9f5e65a8
Pipeline #66168 passed with stage
in 8 minutes and 30 seconds
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "akregator_part.h" #include "akregator_part.h"
#include "akregator_debug.h" #include "akregator_debug.h"
#include "kcmutils_version.h"
#include <MessageViewer/MessageViewerSettings> #include <MessageViewer/MessageViewerSettings>
...@@ -38,6 +39,8 @@ ...@@ -38,6 +39,8 @@
#include <KConfig> #include <KConfig>
#include <KMessageBox> #include <KMessageBox>
#include <KNotifyConfigWidget> #include <KNotifyConfigWidget>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <PimCommon/BroadcastStatus> #include <PimCommon/BroadcastStatus>
#include <QFileDialog> #include <QFileDialog>
#include <kio/filecopyjob.h> #include <kio/filecopyjob.h>
...@@ -607,16 +610,14 @@ void Part::showOptions() ...@@ -607,16 +610,14 @@ void Part::showOptions()
connect(m_dialog, qOverload<>(&KCMultiDialog::configCommitted), TrayIcon::getInstance(), &TrayIcon::settingsChanged); connect(m_dialog, qOverload<>(&KCMultiDialog::configCommitted), TrayIcon::getInstance(), &TrayIcon::settingsChanged);
} }
m_dialog->addModule(QStringLiteral("akregator_config_general")); const QVector<KPluginMetaData> availablePlugins = KPluginLoader::findPlugins(QStringLiteral("pim/kcms/akregator"));
m_dialog->addModule(QStringLiteral("akregator_config_appearance")); for (const KPluginMetaData &metaData : availablePlugins) {
m_dialog->addModule(QStringLiteral("akregator_config_archive")); #if KCMUTILS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
m_dialog->addModule(QStringLiteral("akregator_config_browser")); m_dialog->addModule(metaData);
m_dialog->addModule(QStringLiteral("akregator_config_advanced")); #else
m_dialog->addModule(QStringLiteral("akregator_config_plugins")); m_dialog->addModule(metaData.pluginId());
#ifdef WITH_KUSERFEEDBACK
m_dialog->addModule(QStringLiteral("akregator_config_userfeedback"));
#endif #endif
m_dialog->addModule(QStringLiteral("akregator_config_security")); }
} }
m_dialog->show(); m_dialog->show();
......
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