]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/kcm/kcmdolphinservices.cpp
Make it compile against last kf5 version without deprecated methods
[dolphin.git] / src / settings / kcm / kcmdolphinservices.cpp
index 8bfdefebbe8c44df49fbc54b8edb645bf7583bca..be30663450ca3a2aa5a071026b1fab62beac03d7 100644 (file)
 
 #include "kcmdolphinservices.h"
 
+#include "settings/services/servicessettingspage.h"
+
+#include <kconfigwidgets_version.h>
 #include <KPluginFactory>
 #include <KPluginLoader>
 
-#include <settings/services/servicessettingspage.h>
-
 #include <QVBoxLayout>
 
-K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServicesConfigModule>("dolphinservices");)
-K_EXPORT_PLUGIN(KCMDolphinServicesConfigFactory("kcmdolphinservices"))
+K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServicesConfigModule>(QStringLiteral("dolphinservices"));)
 
 DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) :
     KCModule(parent),
-    m_services(0)
+    m_services(nullptr)
 {
-    Q_UNUSED(args);
+    Q_UNUSED(args)
 
     setButtons(KCModule::Default | KCModule::Help);
 
     QVBoxLayout* topLayout = new QVBoxLayout(this);
-    topLayout->setMargin(0);
+    topLayout->setContentsMargins(0, 0, 0, 0);
 
     m_services = new ServicesSettingsPage(this);
-    connect(m_services, &ServicesSettingsPage::changed, this, static_cast<void(DolphinServicesConfigModule::*)()>(&DolphinServicesConfigModule::changed));
-    topLayout->addWidget(m_services, 0, 0);
+#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0)
+    connect(m_services, &ServicesSettingsPage::changed, this, QOverload<>::of(&DolphinServicesConfigModule::changed));
+#else
+    connect(m_services, &ServicesSettingsPage::changed, this, &DolphinServicesConfigModule::markAsChanged);
+#endif
+    topLayout->addWidget(m_services, 0, nullptr);
 }
 
 DolphinServicesConfigModule::~DolphinServicesConfigModule()