/
lipstickkeymap.cpp
81 lines (70 loc) · 1.81 KB
/
lipstickkeymap.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/***************************************************************************
**
** Copyright (c) 2015 Jolla Ltd.
**
** This file is part of lipstick.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#include "lipstickkeymap.h"
LipstickKeymap::LipstickKeymap(QObject *parent)
: QObject(parent)
{
QWaylandKeymap keymap;
m_rules = keymap.rules();
m_model = keymap.model();
m_layout = keymap.layout();
m_variant = keymap.variant();
m_options = keymap.options();
}
LipstickKeymap::~LipstickKeymap()
{
}
void LipstickKeymap::setRules(const QString &rules)
{
if (m_rules != rules) {
m_rules = rules;
emit rulesChanged();
}
}
void LipstickKeymap::setModel(const QString &model)
{
if (m_model != model) {
m_model = model;
emit modelChanged();
}
}
void LipstickKeymap::setLayout(const QString &layout)
{
if (m_layout != layout) {
m_layout = layout;
emit layoutChanged();
}
}
void LipstickKeymap::setVariant(const QString &variant)
{
if (m_variant != variant) {
m_variant = variant;
emit variantChanged();
}
}
void LipstickKeymap::setOptions(const QString &options)
{
if (m_options != options) {
m_options = options;
emit optionsChanged();
}
}
bool operator!=(const LipstickKeymap &a, const LipstickKeymap &b)
{
return a.rules() != b.rules() ||
a.model() != b.model() ||
a.layout() != b.layout() ||
a.variant() != b.variant() ||
a.options() != b.options();
}