Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kcm/touchpadconfigcontainer.cpp
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <KWindowSystem/kwindowsystem.h> | 25 | #include <KWindowSystem/kwindowsystem.h> | ||
26 | 26 | | |||
27 | extern "C" | 27 | extern "C" | ||
28 | { | 28 | { | ||
29 | Q_DECL_EXPORT void kcminit_touchpad() | 29 | Q_DECL_EXPORT void kcminit_touchpad() | ||
30 | { | 30 | { | ||
31 | if (KWindowSystem::isPlatformX11()) { | 31 | if (KWindowSystem::isPlatformX11()) { | ||
32 | TouchpadConfigXlib::kcmInit(); | 32 | TouchpadConfigContainer::kcmInit(); | ||
33 | } | 33 | } | ||
34 | } | 34 | } | ||
35 | } | 35 | } | ||
36 | 36 | | |||
37 | TouchpadConfigContainer::TouchpadConfigContainer(QWidget *parent, const QVariantList &args) | 37 | TouchpadConfigContainer::TouchpadConfigContainer(QWidget *parent, const QVariantList &args) | ||
38 | : KCModule(parent, args) | 38 | : KCModule(parent, args) | ||
39 | { | 39 | { | ||
40 | TouchpadBackend *backend = TouchpadBackend::implementation(); | 40 | TouchpadBackend *backend = TouchpadBackend::implementation(); | ||
41 | if (KWindowSystem::isPlatformX11()) { | 41 | if (KWindowSystem::isPlatformX11()) { | ||
42 | if (backend->getMode() == TouchpadInputBackendMode::XLibinput) { | 42 | if (backend->getMode() == TouchpadInputBackendMode::XLibinput) { | ||
43 | m_plugin = new TouchpadConfigLibinput(this, backend); | 43 | m_plugin = new TouchpadConfigLibinput(this, backend); | ||
44 | } | 44 | } | ||
45 | else if (backend->getMode() == TouchpadInputBackendMode::XSynaptics) { | 45 | else if (backend->getMode() == TouchpadInputBackendMode::XSynaptics) { | ||
46 | m_plugin = new TouchpadConfigXlib(this, backend); | 46 | m_plugin = new TouchpadConfigXlib(this, backend); | ||
47 | } | 47 | } | ||
48 | } else if (KWindowSystem::isPlatformWayland()) { | 48 | } else if (KWindowSystem::isPlatformWayland()) { | ||
49 | m_plugin = new TouchpadConfigLibinput(this, backend); | 49 | m_plugin = new TouchpadConfigLibinput(this, backend); | ||
50 | } | 50 | } | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | void TouchpadConfigContainer::kcmInit() | ||||
54 | { | ||||
55 | TouchpadBackend *backend = TouchpadBackend::implementation(); | ||||
56 | if (backend->getMode() == TouchpadInputBackendMode::XLibinput) { | ||||
57 | backend->getConfig(); | ||||
58 | backend->applyConfig(); | ||||
59 | } | ||||
davidedmundson: pedantically
} else if { | |||||
60 | else if (backend->getMode() == TouchpadInputBackendMode::XSynaptics) { | ||||
61 | TouchpadConfigXlib::kcmInit(); | ||||
62 | } | ||||
63 | } | ||||
64 | | ||||
53 | QSize TouchpadConfigContainer::minimumSizeHint() const | 65 | QSize TouchpadConfigContainer::minimumSizeHint() const | ||
54 | { | 66 | { | ||
55 | return m_plugin->minimumSizeHint(); | 67 | return m_plugin->minimumSizeHint(); | ||
56 | } | 68 | } | ||
57 | QSize TouchpadConfigContainer::sizeHint() const | 69 | QSize TouchpadConfigContainer::sizeHint() const | ||
58 | { | 70 | { | ||
59 | return m_plugin->sizeHint(); | 71 | return m_plugin->sizeHint(); | ||
60 | } | 72 | } | ||
Show All 26 Lines |
pedantically
} else if {