From d11288293c92ca648793601cfe674dab59ff9a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 23 Jul 2013 11:30:52 +0200 Subject: [PATCH] Port GenericScriptedConfig KCModule needs a KAboutData as argument and KPluginFactory provides componentName() as static method. --- scripting/CMakeLists.txt | 6 +++++- scripting/genericscriptedconfig.cpp | 17 +++++++++-------- scripting/genericscriptedconfig.h | 6 +++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/scripting/CMakeLists.txt b/scripting/CMakeLists.txt index 8630b022fb..ae2816b966 100644 --- a/scripting/CMakeLists.txt +++ b/scripting/CMakeLists.txt @@ -1,4 +1,8 @@ set(kcm_kwin4_genericscripted_SRCS genericscriptedconfig.cpp) kde4_add_plugin( kcm_kwin4_genericscripted ${kcm_kwin4_genericscripted_SRCS} ) -target_link_libraries( kcm_kwin4_genericscripted ${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTUITOOLS_LIBRARY} ) +target_link_libraries( kcm_kwin4_genericscripted + ${KDE4Support_LIBRARIES} # KStandardDirs + ${KDE4_KDEUI_LIBRARY} #KCModule + KF5::plasma + ${Qt5UiTools_LIBRARIES} ) install( TARGETS kcm_kwin4_genericscripted DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/scripting/genericscriptedconfig.cpp b/scripting/genericscriptedconfig.cpp index 45dfeef4ea..607b4e2155 100644 --- a/scripting/genericscriptedconfig.cpp +++ b/scripting/genericscriptedconfig.cpp @@ -20,6 +20,7 @@ #include "genericscriptedconfig.h" #include "config-kwin.h" +#include #include #include #include @@ -43,14 +44,14 @@ QObject *GenericScriptedConfigFactory::create(const char *iface, QWidget *parent Q_UNUSED(iface) Q_UNUSED(parent) if (keyword.startsWith(QStringLiteral("kwin4_effect_"))) { - return new ScriptedEffectConfig(componentData(), keyword, parentWidget, args); + return new ScriptedEffectConfig(componentName(), keyword, parentWidget, args); } else { - return new ScriptingConfig(componentData(), keyword, parentWidget, args); + return new ScriptingConfig(componentName(), keyword, parentWidget, args); } } -GenericScriptedConfig::GenericScriptedConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args) - : KCModule(data, parent, args) +GenericScriptedConfig::GenericScriptedConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args) + : KCModule(KAboutData::pluginData(componentName), parent, args) , m_packageName(keyword) { } @@ -104,8 +105,8 @@ void GenericScriptedConfig::reload() { } -ScriptedEffectConfig::ScriptedEffectConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args) - : GenericScriptedConfig(data, keyword, parent, args) +ScriptedEffectConfig::ScriptedEffectConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args) + : GenericScriptedConfig(componentName, keyword, parent, args) { createUi(); } @@ -134,8 +135,8 @@ void ScriptedEffectConfig::reload() QDBusConnection::sessionBus().send(message); } -ScriptingConfig::ScriptingConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args) - : GenericScriptedConfig(data, keyword, parent, args) +ScriptingConfig::ScriptingConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args) + : GenericScriptedConfig(componentName, keyword, parent, args) { createUi(); } diff --git a/scripting/genericscriptedconfig.h b/scripting/genericscriptedconfig.h index 6d61bafce0..b73bf83711 100644 --- a/scripting/genericscriptedconfig.h +++ b/scripting/genericscriptedconfig.h @@ -42,7 +42,7 @@ class GenericScriptedConfig : public KCModule Q_OBJECT public: - GenericScriptedConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args); + GenericScriptedConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args); virtual ~GenericScriptedConfig(); public Q_SLOTS: @@ -63,7 +63,7 @@ class ScriptedEffectConfig : public GenericScriptedConfig { Q_OBJECT public: - ScriptedEffectConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args); + ScriptedEffectConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args); virtual ~ScriptedEffectConfig(); protected: virtual QString typeName() const; @@ -75,7 +75,7 @@ class ScriptingConfig : public GenericScriptedConfig { Q_OBJECT public: - ScriptingConfig(const KComponentData &data, const QString &keyword, QWidget *parent, const QVariantList &args); + ScriptingConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args); virtual ~ScriptingConfig(); protected: