Commit aa652fcb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to new api

parent 98ba8a88
Pipeline #75641 passed with stage
in 24 minutes and 10 seconds
......@@ -11,6 +11,7 @@
// my headers:
#include "configuredialog.h"
#include "configuredialog_p.h"
#include "kcoreaddons_version.h"
#include "kmkernel.h"
#include "settings/kmailsettings.h"
......@@ -26,11 +27,17 @@ ConfigureDialog::ConfigureDialog(QWidget *parent, bool modal)
setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Help | QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Cancel | QDialogButtonBox::Apply
| QDialogButtonBox::Reset);
setModal(modal);
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
const QVector<KPluginMetaData> availablePlugins = KPluginLoader::findPlugins(QStringLiteral("pim/kcms/kmail"));
for (const KPluginMetaData &metaData : availablePlugins) {
addModule(metaData);
}
#else
const QVector<KPluginMetaData> availablePlugins = KPluginMetaData::findPlugins(QStringLiteral("pim/kcms/kmail"));
for (const KPluginMetaData &metaData : availablePlugins) {
addModule(metaData);
}
#endif
connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &ConfigureDialog::slotOk);
connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &ConfigureDialog::slotApply);
......
......@@ -8,7 +8,7 @@
*/
#include "kcmkontactsummary.h"
#include "kcoreaddons_version.h"
#include <KAboutData>
#include <KConfig>
#include <KLocalizedString>
......@@ -96,9 +96,15 @@ KCMKontactSummary::KCMKontactSummary(QWidget *parent, const QVariantList &args)
void KCMKontactSummary::load()
{
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
const QVector<KPluginMetaData> pluginMetaDatas = KPluginLoader::findPlugins(QStringLiteral("kontact5"), [](const KPluginMetaData &data) {
return data.rawData().value(QStringLiteral("X-KDE-KontactPluginVersion")).toInt() == KONTACT_PLUGIN_VERSION;
});
#else
const QVector<KPluginMetaData> pluginMetaDatas = KPluginMetaData::findPlugins(QStringLiteral("kontact5"), [](const KPluginMetaData &data) {
return data.rawData().value(QStringLiteral("X-KDE-KontactPluginVersion")).toInt() == KONTACT_PLUGIN_VERSION;
});
#endif
QStringList activeSummaries;
......
......@@ -11,7 +11,7 @@
#include "summaryview_part.h"
#include "dropwidget.h"
#include "kcoreaddons_version.h"
#include <PimCommon/BroadcastStatus>
using PimCommon::BroadcastStatus;
......@@ -408,11 +408,17 @@ void SummaryViewPart::slotConfigure()
dlg->setObjectName(QStringLiteral("ConfigDialog"));
dlg->setModal(true);
connect(dlg.data(), qOverload<>(&KCMultiDialog::configCommitted), this, &SummaryViewPart::updateWidgets);
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
const auto metaDataList = KPluginLoader::findPlugins(QStringLiteral("pim/kcms/summary/"));
for (const auto &metaData : metaDataList) {
dlg->addModule(metaData);
}
#else
const auto metaDataList = KPluginMetaData::findPlugins(QStringLiteral("pim/kcms/summary/"));
for (const auto &metaData : metaDataList) {
dlg->addModule(metaData);
}
#endif
dlg->exec();
delete dlg;
......
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