Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout.cpp
Show All 12 Lines | |||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
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 "keyboard_layout.h" | 20 | #include "keyboard_layout.h" | ||
21 | #include "keyboard_layout_switching.h" | ||||
21 | #include "keyboard_input.h" | 22 | #include "keyboard_input.h" | ||
22 | #include "input_event.h" | 23 | #include "input_event.h" | ||
23 | #include "main.h" | 24 | #include "main.h" | ||
24 | #include "platform.h" | 25 | #include "platform.h" | ||
25 | #include "utils.h" | 26 | #include "utils.h" | ||
26 | 27 | | |||
27 | #include <KConfigGroup> | 28 | #include <KConfigGroup> | ||
28 | #include <KGlobalAccel> | 29 | #include <KGlobalAccel> | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 157 | { | |||
157 | m_xkb->switchToLayout(index); | 158 | m_xkb->switchToLayout(index); | ||
158 | checkLayoutChange(); | 159 | checkLayoutChange(); | ||
159 | } | 160 | } | ||
160 | 161 | | |||
161 | void KeyboardLayout::reconfigure() | 162 | void KeyboardLayout::reconfigure() | ||
162 | { | 163 | { | ||
163 | if (m_config) { | 164 | if (m_config) { | ||
164 | m_config->reparseConfiguration(); | 165 | m_config->reparseConfiguration(); | ||
166 | const QString policyKey = m_config->group(QStringLiteral("Layout")).readEntry("SwitchMode", QStringLiteral("Global")); | ||||
167 | if (!m_policy || m_policy->name() != policyKey) { | ||||
168 | delete m_policy; | ||||
169 | m_policy = KeyboardLayoutSwitching::Policy::create(m_xkb, this, policyKey); | ||||
170 | } | ||||
165 | } | 171 | } | ||
166 | m_xkb->reconfigure(); | 172 | m_xkb->reconfigure(); | ||
167 | resetLayout(); | 173 | resetLayout(); | ||
168 | } | 174 | } | ||
169 | 175 | | |||
170 | void KeyboardLayout::resetLayout() | 176 | void KeyboardLayout::resetLayout() | ||
171 | { | 177 | { | ||
172 | m_layout = m_xkb->currentLayout(); | 178 | m_layout = m_xkb->currentLayout(); | ||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |