[kwin/genericscriptedkcm] Generate dbus interface from XML description

This commit is contained in:
Martin Gräßlin 2014-03-19 08:10:45 +01:00
parent 7ca25ac703
commit 8699fe5e5a
3 changed files with 7 additions and 8 deletions

View file

@ -222,6 +222,7 @@ configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h )
########### global ###############
set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml)
include_directories(BEFORE
${CMAKE_CURRENT_BINARY_DIR}/libkdecorations

View file

@ -1,4 +1,5 @@
set(kcm_kwin4_genericscripted_SRCS genericscriptedconfig.cpp)
qt5_add_dbus_interface(kcm_kwin4_genericscripted_SRCS ${kwin_effects_dbus_xml} kwineffects_interface)
add_library(kcm_kwin4_genericscripted MODULE ${kcm_kwin4_genericscripted_SRCS})
target_link_libraries( kcm_kwin4_genericscripted
KF5::ConfigWidgets #KCModule

View file

@ -20,12 +20,11 @@
#include "genericscriptedconfig.h"
#include "config-kwin.h"
#include <kwineffects_interface.h>
#include <KAboutData>
#include <KLocalizedString>
#include <kconfigloader.h>
#include <QDBusConnection>
#include <QDBusMessage>
#include <QFile>
#include <QLabel>
#include <QUiLoader>
@ -127,12 +126,10 @@ KConfigGroup ScriptedEffectConfig::configGroup()
void ScriptedEffectConfig::reload()
{
QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kwin"),
QStringLiteral("/KWin"),
QStringLiteral("org.kde.KWin"),
QStringLiteral("reconfigureEffect"));
message << QString(packageName());
QDBusConnection::sessionBus().send(message);
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.kwin.Effects"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
interface.reconfigureEffect(packageName());
}
ScriptingConfig::ScriptingConfig(const QString &componentName, const QString &keyword, QWidget *parent, const QVariantList &args)