File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11#pragma once
2+ #include < QString>
23#include < vector>
34
45// Auto-generated based on "/usr/share/X11/xkb/rules/evdev.lst"
56
67struct layout
78{
8- const char * code;
9- const char * description;
9+ QString code;
10+ QString description;
1011};
1112
1213static std::vector<struct layout > evdev_lst_layouts = {
Original file line number Diff line number Diff line change 22from enum import Enum
33
44HEADER = """#pragma once
5+ #include <QString>
56#include <vector>
67
78// Auto-generated based on "/usr/share/X11/xkb/rules/evdev.lst"
89
910struct layout
1011{
11- const char * code;
12- const char * description;
12+ QString code;
13+ QString description;
1314};
1415
1516static std::vector<struct layout> evdev_lst_layouts = {"""
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ void Language::activate()
2727 /* Keyboard Layout */
2828 ui->layoutCombo ->addItem (tr (" Select layout to add..." ));
2929 for (auto layout : evdev_lst_layouts) {
30- ui->layoutCombo ->addItem (QString ( layout.description ) );
30+ ui->layoutCombo ->addItem (layout.description );
3131 }
3232}
3333
@@ -47,10 +47,11 @@ void Language::onApply()
4747
4848void Language::addSelectedLayout (void )
4949{
50- const char *description = ui->layoutCombo ->currentText ().toLatin1 ().data ();
50+ QString description = ui->layoutCombo ->currentText ();
51+
5152 for (auto layout : evdev_lst_layouts) {
52- if (! strcmp ( description, layout.description ) ) {
53- m_model->addLayout (QString ( layout.code ), QString ( layout.description ) );
53+ if (description == layout.description ) {
54+ m_model->addLayout (layout.code , layout.description );
5455 }
5556 }
5657}
You can’t perform that action at this time.
0 commit comments