Changeset View
Changeset View
Standalone View
Standalone View
effects/coverswitch/coverswitch_config.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "coverswitch_config.h" | 20 | #include "coverswitch_config.h" | ||
21 | // KConfigSkeleton | 21 | // KConfigSkeleton | ||
22 | #include "coverswitchconfig.h" | 22 | #include "coverswitchconfig.h" | ||
23 | #include <config-kwin.h> | ||||
23 | 24 | | |||
24 | #include <kwineffects_interface.h> | 25 | #include <kwineffects_interface.h> | ||
25 | #include <KAboutData> | 26 | #include <KAboutData> | ||
26 | #include <KPluginFactory> | 27 | #include <KPluginFactory> | ||
27 | 28 | | |||
28 | #include <QVBoxLayout> | 29 | #include <QVBoxLayout> | ||
29 | 30 | | |||
30 | K_PLUGIN_FACTORY_WITH_JSON(CoverSwitchEffectConfigFactory, | 31 | K_PLUGIN_FACTORY_WITH_JSON(CoverSwitchEffectConfigFactory, | ||
Show All 12 Lines | 43 | CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariantList& args) : | |||
43 | KCModule(KAboutData::pluginData(QStringLiteral("coverswitch")), parent, args) | 44 | KCModule(KAboutData::pluginData(QStringLiteral("coverswitch")), parent, args) | ||
44 | { | 45 | { | ||
45 | m_ui = new CoverSwitchEffectConfigForm(this); | 46 | m_ui = new CoverSwitchEffectConfigForm(this); | ||
46 | 47 | | |||
47 | QVBoxLayout* layout = new QVBoxLayout(this); | 48 | QVBoxLayout* layout = new QVBoxLayout(this); | ||
48 | 49 | | |||
49 | layout->addWidget(m_ui); | 50 | layout->addWidget(m_ui); | ||
50 | 51 | | |||
52 | CoverSwitchConfig::instance(KWIN_CONFIG); | ||||
51 | addConfig(CoverSwitchConfig::self(), m_ui); | 53 | addConfig(CoverSwitchConfig::self(), m_ui); | ||
52 | } | 54 | } | ||
53 | 55 | | |||
54 | void CoverSwitchEffectConfig::save() | 56 | void CoverSwitchEffectConfig::save() | ||
55 | { | 57 | { | ||
56 | KCModule::save(); | 58 | KCModule::save(); | ||
57 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | 59 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | ||
58 | QStringLiteral("/Effects"), | 60 | QStringLiteral("/Effects"), | ||
59 | QDBusConnection::sessionBus()); | 61 | QDBusConnection::sessionBus()); | ||
60 | interface.reconfigureEffect(QStringLiteral("coverswitch")); | 62 | interface.reconfigureEffect(QStringLiteral("coverswitch")); | ||
61 | } | 63 | } | ||
62 | 64 | | |||
63 | } // namespace | 65 | } // namespace | ||
64 | 66 | | |||
65 | #include "coverswitch_config.moc" | 67 | #include "coverswitch_config.moc" |