Commit a845e67a authored by Andrey Butirsky's avatar Andrey Butirsky
Browse files

[kcms/keyboard] Drop legacy keyboard indicator

A new applet was created that speaks DBus. Having the old settings is a
very confusing user experience. It is also a lot of now obsoleted code.

CCBUG: 430661
parent e7713ff8
......@@ -27,9 +27,6 @@ set( kded_keyboard_SRCS
keyboard_config.cpp
keyboard_hardware.cpp
bindings.cpp
# next are temporary for sys tray UI
layout_tray_icon.cpp
layouts_menu.cpp
flags.cpp
xkb_rules.cpp
layoutnames.cpp
......
......@@ -55,7 +55,7 @@ QAction *KeyboardLayoutActionCollection::getToggleAction()
return action(0);
}
QAction *KeyboardLayoutActionCollection::createLayoutShortcutActon(const LayoutUnit &layoutUnit, const Rules *rules, bool autoload)
QAction *KeyboardLayoutActionCollection::createLayoutShortcutActon(const LayoutUnit &layoutUnit, int layoutIndex, const Rules *rules, bool autoload)
{
QString longLayoutName = Flags::getLongText(layoutUnit, rules);
QString actionName = QStringLiteral("Switch keyboard layout to ");
......@@ -68,7 +68,7 @@ QAction *KeyboardLayoutActionCollection::createLayoutShortcutActon(const LayoutU
shortcuts << layoutUnit.getShortcut();
}
KGlobalAccel::self()->setShortcut(action, shortcuts, loading);
action->setData(layoutUnit.toString());
action->setData(layoutIndex);
if (configAction) {
action->setProperty("isConfigurationAction", true);
}
......@@ -82,10 +82,10 @@ void KeyboardLayoutActionCollection::setToggleShortcut(const QKeySequence &keySe
void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit> &layoutUnits, const Rules *rules)
{
for (QList<LayoutUnit>::iterator i = layoutUnits.begin(); i != layoutUnits.end(); ++i) {
LayoutUnit &layoutUnit = *i;
for (int i = 0; i < layoutUnits.size(); ++i) {
const LayoutUnit &layoutUnit = layoutUnits.at(i);
if (!layoutUnit.getShortcut().isEmpty()) {
createLayoutShortcutActon(layoutUnit, rules, false);
createLayoutShortcutActon(layoutUnit, i, rules, false);
}
}
qCDebug(KCM_KEYBOARD) << "Cleaning component shortcuts on save" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
......@@ -93,9 +93,9 @@ void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit> &layou
void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit> &layoutUnits, const Rules *rules)
{
for (QList<LayoutUnit>::iterator i = layoutUnits.begin(); i != layoutUnits.end(); ++i) {
LayoutUnit &layoutUnit = *i;
QAction *action = createLayoutShortcutActon(layoutUnit, rules, true);
for (int i = 0; i < layoutUnits.size(); ++i) {
LayoutUnit &layoutUnit = layoutUnits[i];
QAction *action = createLayoutShortcutActon(layoutUnit, i, rules, true);
const auto shortcut = KGlobalAccel::self()->shortcut(action);
if (!shortcut.isEmpty()) {
qCDebug(KCM_KEYBOARD, ) << "Restored shortcut for" << layoutUnit.toString() << shortcut.first();
......
......@@ -33,7 +33,7 @@ public:
~KeyboardLayoutActionCollection() override;
QAction *getToggleAction();
QAction *createLayoutShortcutActon(const LayoutUnit &layoutUnit, const Rules *rules, bool autoload);
QAction *createLayoutShortcutActon(const LayoutUnit &layoutUnit, int layoutIndex, const Rules *rules, bool autoload);
void setLayoutShortcuts(QList<LayoutUnit> &layoutUnits, const Rules *rules);
void setToggleShortcut(const QKeySequence &keySequence);
void loadLayoutShortcuts(QList<LayoutUnit> &layoutUnits, const Rules *rules);
......
......@@ -20,14 +20,8 @@
#include <KLocalizedString>
#include <KFontUtils>
#include <plasma/svg.h>
#include <plasma/theme.h>
#include <QFontDatabase>
#include <QIcon>
#include <QPainter>
#include <QPalette>
#include <QPixmap>
#include <QStandardPaths>
#include <QStringList>
......@@ -40,7 +34,6 @@
#include "keyboard_config.h"
#include "xkb_rules.h"
static const int FLAG_MAX_SIZE = 22;
static const char flagTemplate[] = "kf5/locale/countries/%1/flag.png";
int iconSize(int s)
......@@ -60,22 +53,6 @@ int iconSize(int s)
}
}
Flags::Flags()
: svg(nullptr)
{
transparentPixmap = new QPixmap(FLAG_MAX_SIZE, FLAG_MAX_SIZE);
transparentPixmap->fill(Qt::transparent);
}
Flags::~Flags()
{
if (svg != nullptr) {
disconnect(svg, &Plasma::Svg::repaintNeeded, this, &Flags::themeChanged);
delete svg;
}
delete transparentPixmap;
}
const QIcon Flags::getIcon(const QString &layout)
{
if (!iconMap.contains(layout)) {
......@@ -159,13 +136,6 @@ QString Flags::getShortText(const LayoutUnit &layoutUnit, const KeyboardConfig &
return layoutText;
}
QString Flags::getFullText(const LayoutUnit &layoutUnit, const KeyboardConfig &keyboardConfig, const Rules *rules)
{
QString shortText = Flags::getShortText(layoutUnit, keyboardConfig);
QString longText = Flags::getLongText(layoutUnit, rules);
return i18nc("short layout label - full layout name", "%1 - %2", shortText, longText);
}
static QString getDisplayText(const QString &layout, const QString &variant, const Rules *rules)
{
if (variant.isEmpty())
......@@ -196,105 +166,3 @@ QString Flags::getLongText(const LayoutUnit &layoutUnit, const Rules *rules)
return layoutText;
}
static QString getPixmapKey(const KeyboardConfig &keyboardConfig)
{
switch (keyboardConfig.indicatorType) {
case KeyboardConfig::SHOW_FLAG:
return QStringLiteral("_fl");
case KeyboardConfig::SHOW_LABEL_ON_FLAG:
return QStringLiteral("_bt");
case KeyboardConfig::SHOW_LABEL:
return QStringLiteral("_lb");
}
return QStringLiteral("_"); // should not happen
}
void Flags::drawLabel(QPainter &painter, const QString &layoutText, bool flagShown, ColorType colorType)
{
QFont font = painter.font();
QRect rect = painter.window();
font.setPointSize(KFontUtils::adaptFontSize(painter, layoutText, rect.size(), rect.height()));
// we init svg so that we get notification about theme change
getSvg();
QColor textColor;
if (flagShown) {
textColor = Qt::black;
} else if (colorType == ColorType::Plasma) {
textColor = Plasma::Theme().color(Plasma::Theme::TextColor);
} else {
textColor = QPalette().color(QPalette::Text);
}
painter.setPen(textColor);
painter.setFont(font);
painter.drawText(rect, Qt::AlignCenter, layoutText);
}
const QIcon Flags::getIconWithText(const LayoutUnit &layoutUnit, const KeyboardConfig &keyboardConfig, ColorType colorType)
{
const QString keySuffix(getPixmapKey(keyboardConfig));
const QString key(layoutUnit.toString() + keySuffix);
if (iconOrTextMap.contains(key)) {
return iconOrTextMap[key];
}
if (keyboardConfig.indicatorType == KeyboardConfig::SHOW_FLAG) {
QIcon icon = getIcon(layoutUnit.layout());
if (!icon.isNull()) {
iconOrTextMap[key] = icon;
return icon;
}
}
QString layoutText = Flags::getShortText(layoutUnit, keyboardConfig);
const QSize TRAY_ICON_SIZE(128, 128);
QPixmap pixmap = QPixmap(TRAY_ICON_SIZE);
pixmap.fill(Qt::transparent);
QPainter painter(&pixmap);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
// p.setRenderHint(QPainter::Antialiasing);
if (keyboardConfig.indicatorType == KeyboardConfig::SHOW_LABEL_ON_FLAG) {
QIcon iconf = createIcon(layoutUnit.layout());
painter.drawPixmap(pixmap.rect(), iconf.pixmap(TRAY_ICON_SIZE));
}
drawLabel(painter, layoutText, keyboardConfig.isFlagShown(), colorType);
painter.end();
QIcon icon(pixmap);
iconOrTextMap[key] = icon;
return icon;
}
Plasma::Svg *Flags::getSvg()
{
if (svg == nullptr) {
svg = new Plasma::Svg;
svg->setImagePath(QStringLiteral("widgets/labeltexture"));
svg->setContainsMultipleImages(true);
connect(svg, &Plasma::Svg::repaintNeeded, this, &Flags::themeChanged);
}
return svg;
}
void Flags::themeChanged()
{
// qCDebug(KCM_KEYBOARD, ) << "Theme changed, new text color" << Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
clearCache();
emit pixmapChanged();
}
void Flags::clearCache()
{
// qCDebug(KCM_KEYBOARD, ) << "Clearing flag pixmap cache";
iconOrTextMap.clear();
}
......@@ -23,55 +23,26 @@
#include <QObject>
#include <QString>
class QPixmap;
class QIcon;
class LayoutUnit;
class KeyboardConfig;
struct Rules;
class QPainter;
namespace Plasma
{
class Svg;
}
class Flags : public QObject
{
Q_OBJECT
public:
Flags();
~Flags() override;
enum ColorType { Plasma = Qt::UserRole, ColorScheme };
const QIcon getIcon(const QString &layout);
const QIcon getIconWithText(const LayoutUnit &layoutUnit, const KeyboardConfig &keyboardConfig, ColorType colorType = ColorType::Plasma);
const QPixmap &getTransparentPixmap() const
{
return *transparentPixmap;
}
static QString getLongText(const LayoutUnit &layoutUnit, const Rules *rules);
static QString getShortText(const LayoutUnit &layoutUnit, const KeyboardConfig &keyboardConfig);
static QString getFullText(const LayoutUnit &layoutUnit, const KeyboardConfig &keyboardConfig, const Rules *rules);
public Q_SLOTS:
void themeChanged();
void clearCache();
Q_SIGNALS:
void pixmapChanged();
private:
QIcon createIcon(const QString &layout);
QString getCountryFromLayoutName(const QString &fullLayoutName) const;
void drawLabel(QPainter &painter, const QString &layoutText, bool flagShown, ColorType colorType);
Plasma::Svg *getSvg();
QMap<QString, QIcon> iconMap;
QMap<QString, QIcon> iconOrTextMap;
QPixmap *transparentPixmap;
Plasma::Svg *svg;
};
#endif /* FLAGS_H_ */
......@@ -96,53 +96,6 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="kbuttongroup">
<property name="title">
<string>Layout Indicator</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="showOSD_Chk"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="showIndicatorChk">
<property name="text">
<string>Show layout indicator</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="showSingleChk">
<property name="text">
<string>Show for single layout</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QRadioButton" name="showFlagRadioBtn">
<property name="text">
<string>Show flag</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="showLabelRadioBtn">
<property name="text">
<string>Show label</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QRadioButton" name="showLabelOnFlagRadioBtn">
<property name="text">
<string>Show label on flag</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="switchingPolicyGroupBox">
<property name="whatsThis">
......@@ -210,7 +163,7 @@
<string>Main shortcuts:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>xkbGrpShortcutBtn</cstring>
......@@ -240,7 +193,7 @@
<string>3rd level shortcuts:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>xkb3rdLevelShortcutBtn</cstring>
......@@ -270,7 +223,7 @@
<string>Alternative shortcut:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kdeKeySequence</cstring>
......@@ -287,6 +240,13 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="showOSD_Chk">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -161,21 +161,9 @@ void KCMKeyboardWidget::uiChanged()
m_workspaceOptions.setOsdKbdLayoutChangedEnabled(uiWidget->showOSD_Chk->isChecked());
keyboardConfig->showIndicator = uiWidget->showIndicatorChk->isChecked();
keyboardConfig->showSingle = uiWidget->showSingleChk->isChecked();
keyboardConfig->configureLayouts = uiWidget->layoutsGroupBox->isChecked();
keyboardConfig->keyboardModel = uiWidget->keyboardModelComboBox->itemData(uiWidget->keyboardModelComboBox->currentIndex()).toString();
if (uiWidget->showFlagRadioBtn->isChecked()) {
keyboardConfig->indicatorType = KeyboardConfig::SHOW_FLAG;
} else if (uiWidget->showLabelRadioBtn->isChecked()) {
keyboardConfig->indicatorType = KeyboardConfig::SHOW_LABEL;
} else {
// if( uiWidget->showFlagRadioBtn->isChecked() ) {
keyboardConfig->indicatorType = KeyboardConfig::SHOW_LABEL_ON_FLAG;
}
keyboardConfig->resetOldXkbOptions = uiWidget->configureKeyboardOptionsChk->isChecked();
if (uiWidget->switchByDesktopRadioBtn->isChecked()) {
......@@ -225,10 +213,10 @@ void KCMKeyboardWidget::addLayout()
}
AddLayoutDialog dialog(rules,
keyboardConfig->isFlagShown() ? flags : nullptr,
flags,
keyboardConfig->keyboardModel,
keyboardConfig->xkbOptions,
keyboardConfig->isLabelShown(),
false,
this);
dialog.setModal(true);
if (dialog.exec() == QDialog::Accepted) {
......@@ -277,7 +265,7 @@ void KCMKeyboardWidget::initializeLayoutsUI()
uiWidget->layoutsTableView->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed
| QAbstractItemView::AnyKeyPressed);
uiWidget->layoutsTableView->setModel(layoutsTableModel);
uiWidget->layoutsTableView->setIconSize(flags->getTransparentPixmap().size());
uiWidget->layoutsTableView->setIconSize({22, 22});
// TODO: do we need to delete this delegate or parent will take care of it?
VariantComboDelegate *variantDelegate = new VariantComboDelegate(keyboardConfig, rules, uiWidget->layoutsTableView);
......@@ -346,18 +334,11 @@ void KCMKeyboardWidget::initializeLayoutsUI()
connect(uiWidget->switchingPolicyButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(uiChanged()));
connect(uiWidget->xkbGrpShortcutBtn, &QAbstractButton::clicked, this, &KCMKeyboardWidget::scrollToGroupShortcut);
connect(uiWidget->xkb3rdLevelShortcutBtn, &QAbstractButton::clicked, this, &KCMKeyboardWidget::scrollTo3rdLevelShortcut);
connect(uiWidget->showOSD_Chk, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
// connect(uiWidget->configureLayoutsChk, SIGNAL(toggled(bool)), uiWidget->layoutsGroupBox, SLOT(setEnabled(bool)));
connect(uiWidget->layoutsGroupBox, &QGroupBox::toggled, this, &KCMKeyboardWidget::configureLayoutsChanged);
connect(uiWidget->showOSD_Chk, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->showIndicatorChk, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->showIndicatorChk, &QAbstractButton::toggled, uiWidget->showSingleChk, &QWidget::setEnabled);
connect(uiWidget->showFlagRadioBtn, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->showLabelRadioBtn, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->showLabelOnFlagRadioBtn, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->showSingleChk, &QAbstractButton::toggled, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->layoutLoopingCheckBox, &QAbstractButton::clicked, this, &KCMKeyboardWidget::uiChanged);
connect(uiWidget->layoutLoopCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(uiChanged()));
}
......@@ -646,11 +627,6 @@ void KCMKeyboardWidget::updateLayoutsUI()
{
uiWidget->layoutsGroupBox->setChecked(keyboardConfig->configureLayouts);
uiWidget->showOSD_Chk->setChecked(m_workspaceOptions.osdKbdLayoutChangedEnabled());
uiWidget->showIndicatorChk->setChecked(keyboardConfig->showIndicator);
uiWidget->showSingleChk->setChecked(keyboardConfig->showSingle);
uiWidget->showFlagRadioBtn->setChecked(keyboardConfig->indicatorType == KeyboardConfig::SHOW_FLAG);
uiWidget->showLabelRadioBtn->setChecked(keyboardConfig->indicatorType == KeyboardConfig::SHOW_LABEL);
uiWidget->showLabelOnFlagRadioBtn->setChecked(keyboardConfig->indicatorType == KeyboardConfig::SHOW_LABEL_ON_FLAG);
bool loopingOn = keyboardConfig->configureLayouts && keyboardConfig->layoutLoopCount != KeyboardConfig::NO_LOOPING;
uiWidget->layoutLoopingCheckBox->setChecked(loopingOn);
......
......@@ -56,8 +56,6 @@ void LayoutsTableModel::refresh()
{
beginResetModel();
endResetModel();
countryFlags->clearCache();
}
int LayoutsTableModel::rowCount(const QModelIndex & /*parent*/) const
......@@ -132,8 +130,7 @@ QVariant LayoutsTableModel::data(const QModelIndex &index, int role) const
switch (index.column()) {
case DISPLAY_NAME_COLUMN: {
// if(keyboardConfig->isFlagShown()) {
QIcon icon = countryFlags->getIconWithText(layoutUnit, *keyboardConfig, Flags::ColorType::ColorScheme);
return icon.isNull() ? countryFlags->getTransparentPixmap() : icon;
return countryFlags->getIcon(layoutUnit.layout());
// }
}
// TODO: show the cells are editable
......@@ -233,7 +230,6 @@ bool LayoutsTableModel::setData(const QModelIndex &index, const QVariant &value,
case DISPLAY_NAME_COLUMN: {
QString displayText = value.toString().left(3);
layoutUnit.setDisplayName(displayText);
countryFlags->clearCache(); // regenerate the label
} break;
case VARIANT_COLUMN: {
layoutUnit.setVariant(value.toString());
......@@ -258,9 +254,6 @@ LabelEditDelegate::LabelEditDelegate(const KeyboardConfig *keyboardConfig_, QObj
QWidget *LabelEditDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
if (keyboardConfig->indicatorType == KeyboardConfig::SHOW_FLAG)
return nullptr;
QWidget *widget = QStyledItemDelegate::createEditor(parent, option, index);
QLineEdit *lineEdit = static_cast<QLineEdit *>(widget);
if (lineEdit != nullptr) {
......
......@@ -68,23 +68,6 @@ void KeyboardConfig::setDefaults()
switchingPolicy = SWITCH_POLICY_GLOBAL;
// stickySwitching = false;
// stickySwitchingDepth = 2;
// display options
showIndicator = true;
indicatorType = SHOW_LABEL;
showSingle = false;
}
static KeyboardConfig::IndicatorType getIndicatorType(bool showFlag, bool showLabel)
{
if (showFlag) {
if (showLabel)
return KeyboardConfig::SHOW_LABEL_ON_FLAG;
else
return KeyboardConfig::SHOW_FLAG;
} else {
return KeyboardConfig::SHOW_LABEL;
}
}
void KeyboardConfig::load()
......@@ -123,14 +106,6 @@ void KeyboardConfig::load()
QString layoutMode = config.readEntry("SwitchMode", "Global");
switchingPolicy = static_cast<SwitchingPolicy>(findStringIndex(SWITCHING_POLICIES, layoutMode, SWITCH_POLICY_GLOBAL));
showIndicator = config.readEntry("ShowLayoutIndicator", true);
bool showFlag = config.readEntry("ShowFlag", false);
bool showLabel = config.readEntry("ShowLabel", true);
indicatorType = getIndicatorType(showFlag, showLabel);
showSingle = config.readEntry("ShowSingle", false);
QString labelsStr = config.readEntry("DisplayNames", "");
QStringList labels = labelsStr.split(LIST_SEPARATOR, Qt::KeepEmptyParts);
for (int i = 0; i < labels.count() && i < layouts.count(); i++) {
......@@ -194,11 +169,6 @@ void KeyboardConfig::save()
config.writeEntry("SwitchMode", SWITCHING_POLICIES[switchingPolicy]);
config.writeEntry("ShowLayoutIndicator", showIndicator);
config.writeEntry("ShowFlag", indicatorType == SHOW_FLAG || indicatorType == SHOW_LABEL_ON_FLAG);
config.writeEntry("ShowLabel", indicatorType == SHOW_LABEL || indicatorType == SHOW_LABEL_ON_FLAG);
config.writeEntry("ShowSingle", showSingle);
config.sync();
}
......
......@@ -43,12 +43,6 @@ public:
SWITCH_POLICY_WINDOW = 3,
};
enum IndicatorType {
SHOW_LABEL = 0,
SHOW_FLAG = 1,
SHOW_LABEL_ON_FLAG = 2,
};
QString keyboardModel;
// resetOldXkbOptions is now also "set xkb options"
bool resetOldXkbOptions;
......@@ -64,23 +58,10 @@ public:
// bool stickySwitching;
// int stickySwitchingDepth;
// display options
bool showIndicator;
IndicatorType indicatorType;
bool showSingle;
KeyboardConfig();
QList<LayoutUnit> getDefaultLayouts() const;
QList<LayoutUnit> getExtraLayouts() const;
bool isFlagShown() const
{
return indicatorType == SHOW_FLAG || indicatorType == SHOW_LABEL_ON_FLAG;
}
bool isLabelShown() const
{
return indicatorType == SHOW_LABEL || indicatorType == SHOW_LABEL_ON_FLAG;
}
void setDefaults();
void load();
......
......@@ -30,12 +30,11 @@
#include "keyboard_hardware.h"
#include "layout_memory_persister.h"
#include "layout_tray_icon.h"
#include "layouts_menu.h"
#include "x11_helper.h"
#include "xinput_helper.h"
#include "xkb_helper.h"
#include "xkb_rules.h"
#include "flags.h"
K_PLUGIN_CLASS_WITH_JSON(KeyboardDaemon, "keyboard.json")
......@@ -43,7 +42,6 @@ KeyboardDaemon::KeyboardDaemon(QObject *parent, const QList<QVariant> &)
: KDEDModule(parent)
, actionCollection(nullptr)
, xEventNotifier(nullptr)
, layoutTrayIcon(nullptr)
, layoutMemory(keyboardConfig)
, rules(Rules::readRules(Rules::READ_EXTRAS))
{
......@@ -83,7 +81,6 @@ KeyboardDaemon::~KeyboardDaemon()
unregisterShortcut();
delete xEventNotifier;
delete layoutTrayIcon;
delete rules;