Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/kcm/configcontainer.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Roman Gilg <subdiff@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | #include "configcontainer.h" | ||||
20 | #include "configplugin.h" | ||||
21 | #include "kcm/libinput/libinput_config.h" | ||||
22 | #include "kcm/xlib/xlib_config.h" | ||||
23 | | ||||
24 | #include <KWindowSystem/kwindowsystem.h> | ||||
25 | | ||||
26 | extern "C" | ||||
27 | { | ||||
28 | Q_DECL_EXPORT void kcminit_mouse() | ||||
29 | { | ||||
30 | if (KWindowSystem::isPlatformX11()) { | ||||
31 | XlibConfig::kcmInit(); | ||||
32 | } | ||||
33 | } | ||||
34 | } | ||||
35 | | ||||
36 | ConfigContainer::ConfigContainer(QWidget *parent, const QVariantList &args) | ||||
37 | : KCModule(parent, args) | ||||
38 | { | ||||
39 | m_plugin = ConfigPlugin::implementation(this); | ||||
40 | } | ||||
41 | | ||||
42 | QSize ConfigContainer::minimumSizeHint() const | ||||
43 | { | ||||
44 | return m_plugin->minimumSizeHint(); | ||||
45 | } | ||||
46 | QSize ConfigContainer::sizeHint() const | ||||
47 | { | ||||
48 | return m_plugin->sizeHint(); | ||||
49 | } | ||||
50 | void ConfigContainer::resizeEvent(QResizeEvent *event) | ||||
51 | { | ||||
52 | Q_EMIT changed(false); | ||||
53 | m_plugin->resize(this->size()); | ||||
54 | } | ||||
55 | | ||||
56 | void ConfigContainer::load() | ||||
57 | { | ||||
58 | m_plugin->load(); | ||||
59 | } | ||||
60 | | ||||
61 | void ConfigContainer::save() | ||||
62 | { | ||||
63 | m_plugin->save(); | ||||
64 | } | ||||
65 | | ||||
66 | void ConfigContainer::defaults() | ||||
67 | { | ||||
68 | m_plugin->defaults(); | ||||
69 | } | ||||
70 | | ||||
71 | void ConfigContainer::hideEvent(QHideEvent *e) | ||||
72 | { | ||||
73 | m_plugin->hideEvent(e); | ||||
74 | KCModule::hideEvent(e); | ||||
75 | } |