-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 4 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 1fba9bc..fe5051d 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp | |||
@@ -66,33 +66,33 @@ ConfigDlg::ConfigDlg () : QDialog () | |||
66 | tb1->setAutoRaise(TRUE); | 66 | tb1->setAutoRaise(TRUE); |
67 | tb1->setFocusPolicy(QWidget::NoFocus); | 67 | tb1->setFocusPolicy(QWidget::NoFocus); |
68 | tb1->setToggleButton(FALSE); | 68 | tb1->setToggleButton(FALSE); |
69 | connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); | 69 | connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); |
70 | 70 | ||
71 | QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); | 71 | QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); |
72 | tb2->setPixmap(Resource::loadPixmap("down")); | 72 | tb2->setPixmap(Resource::loadPixmap("down")); |
73 | tb2->setAutoRaise(TRUE); | 73 | tb2->setAutoRaise(TRUE); |
74 | tb2->setFocusPolicy(QWidget::NoFocus); | 74 | tb2->setFocusPolicy(QWidget::NoFocus); |
75 | tb2->setToggleButton(FALSE); | 75 | tb2->setToggleButton(FALSE); |
76 | connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); | 76 | connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); |
77 | 77 | ||
78 | QString cur(tr("Current Language")); | 78 | QString cur(tr("Current Language")); |
79 | keymaps->insertItem(cur); | 79 | keymaps->insertItem(cur); |
80 | keymaps->setSelected(0, true); | 80 | keymaps->setSelected(0, true); |
81 | 81 | ||
82 | QDir map_dir(QPEApplication::qpeDir() + "/share/multikey", "*.keymap"); | 82 | QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); |
83 | default_maps = map_dir.entryList(); // so i can access it in other places | 83 | default_maps = map_dir.entryList(); // so i can access it in other places |
84 | custom_maps = config.readListEntry("maps", QChar('|')); | 84 | custom_maps = config.readListEntry("maps", QChar('|')); |
85 | sw_maps = ConfigDlg::loadSw(); | 85 | sw_maps = ConfigDlg::loadSw(); |
86 | 86 | ||
87 | QStringList sw_copy(sw_maps); | 87 | QStringList sw_copy(sw_maps); |
88 | for (uint i = 0; i < sw_copy.count(); i++) { | 88 | for (uint i = 0; i < sw_copy.count(); i++) { |
89 | 89 | ||
90 | QString keymap_map; | 90 | QString keymap_map; |
91 | if (sw_copy[i][0] != '/') { /* share/multikey */ | 91 | if (sw_copy[i][0] != '/') { /* share/multikey */ |
92 | 92 | ||
93 | keymap_map = map_dir.absPath() + "/" + sw_copy[i]; | 93 | keymap_map = map_dir.absPath() + "/" + sw_copy[i]; |
94 | } else { | 94 | } else { |
95 | 95 | ||
96 | if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) | 96 | if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) |
97 | || !QFile::exists(sw_copy[i])) { | 97 | || !QFile::exists(sw_copy[i])) { |
98 | 98 | ||
@@ -235,33 +235,33 @@ ConfigDlg::ConfigDlg () : QDialog () | |||
235 | label = new QLabel("", color_grid); // a spacer so the above buttons dont expand | 235 | label = new QLabel("", color_grid); // a spacer so the above buttons dont expand |
236 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 236 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
237 | /* FIXME: hacked spacer height */ | 237 | /* FIXME: hacked spacer height */ |
238 | QSpacerItem *spacer = new QSpacerItem(0, 300, QSizePolicy::Expanding, QSizePolicy::Maximum); | 238 | QSpacerItem *spacer = new QSpacerItem(0, 300, QSizePolicy::Expanding, QSizePolicy::Maximum); |
239 | 239 | ||
240 | color_lay->addWidget(color_grid, 0, 0); | 240 | color_lay->addWidget(color_grid, 0, 0); |
241 | color_lay->addItem(spacer); | 241 | color_lay->addItem(spacer); |
242 | 242 | ||
243 | tabs->addTab(color_box, tr("Colors")); | 243 | tabs->addTab(color_box, tr("Colors")); |
244 | base_lay->addWidget(tabs); | 244 | base_lay->addWidget(tabs); |
245 | } | 245 | } |
246 | 246 | ||
247 | QStringList ConfigDlg::loadSw() | 247 | QStringList ConfigDlg::loadSw() |
248 | { | 248 | { |
249 | Config *config = new Config("multikey"); | 249 | Config *config = new Config("multikey"); |
250 | config->setGroup("keymaps"); | 250 | config->setGroup("keymaps"); |
251 | QDir map_dir(QPEApplication::qpeDir() + "/share/multikey", "*.keymap"); | 251 | QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); |
252 | QStringList d_maps = map_dir.entryList(); // so i can access it in other places | 252 | QStringList d_maps = map_dir.entryList(); // so i can access it in other places |
253 | QStringList c_maps = config->readListEntry("maps", QChar('|')); | 253 | QStringList c_maps = config->readListEntry("maps", QChar('|')); |
254 | QStringList s_maps = config->readListEntry("sw", QChar('|')); | 254 | QStringList s_maps = config->readListEntry("sw", QChar('|')); |
255 | delete config; | 255 | delete config; |
256 | 256 | ||
257 | if (!s_maps.count()) | 257 | if (!s_maps.count()) |
258 | { | 258 | { |
259 | s_maps = d_maps+c_maps; | 259 | s_maps = d_maps+c_maps; |
260 | } | 260 | } |
261 | else | 261 | else |
262 | { | 262 | { |
263 | /* Clear non existents entries */ | 263 | /* Clear non existents entries */ |
264 | QStringList s_copy(s_maps); | 264 | QStringList s_copy(s_maps); |
265 | for (uint i = 0; i < s_copy.count(); ++i) { | 265 | for (uint i = 0; i < s_copy.count(); ++i) { |
266 | if (d_maps.find(s_copy[i]) == d_maps.end() | 266 | if (d_maps.find(s_copy[i]) == d_maps.end() |
267 | && c_maps.find(s_copy[i]) == c_maps.end()) { | 267 | && c_maps.find(s_copy[i]) == c_maps.end()) { |
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 7ddfd3e..f8cafd5 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -1364,38 +1364,38 @@ ushort Keyboard::constoe(const ushort c) { | |||
1364 | // Keys::Keys {{{1 | 1364 | // Keys::Keys {{{1 |
1365 | 1365 | ||
1366 | Keys::Keys() { | 1366 | Keys::Keys() { |
1367 | 1367 | ||
1368 | Config *config = new Config ("multikey"); | 1368 | Config *config = new Config ("multikey"); |
1369 | config->setGroup( "keymaps" ); | 1369 | config->setGroup( "keymaps" ); |
1370 | QString map = config->readEntry( "current" ); | 1370 | QString map = config->readEntry( "current" ); |
1371 | delete config; | 1371 | delete config; |
1372 | 1372 | ||
1373 | if (map.isNull() || !(QFile(map).exists())) { | 1373 | if (map.isNull() || !(QFile(map).exists())) { |
1374 | 1374 | ||
1375 | Config *config = new Config("locale"); | 1375 | Config *config = new Config("locale"); |
1376 | config->setGroup( "Language" ); | 1376 | config->setGroup( "Language" ); |
1377 | QString l = config->readEntry( "Language" , "en" ); | 1377 | QString l = config->readEntry( "Language" , "en" ); |
1378 | delete config; | 1378 | delete config; |
1379 | 1379 | ||
1380 | map = QPEApplication::qpeDir() + "/share/multikey/" | 1380 | map = QPEApplication::qpeDir() + "share/multikey/" |
1381 | + l + ".keymap"; | 1381 | + l + ".keymap"; |
1382 | 1382 | ||
1383 | } | 1383 | } |
1384 | if (map.isNull() || !(QFile(map).exists())) { | 1384 | if (map.isNull() || !(QFile(map).exists())) { |
1385 | map = QPEApplication::qpeDir() + "/share/multikey/en.keymap"; | 1385 | map = QPEApplication::qpeDir() + "share/multikey/en.keymap"; |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | setKeysFromFile(map); | 1388 | setKeysFromFile(map); |
1389 | } | 1389 | } |
1390 | 1390 | ||
1391 | Keys::Keys(const char * filename) { | 1391 | Keys::Keys(const char * filename) { |
1392 | 1392 | ||
1393 | setKeysFromFile(filename); | 1393 | setKeysFromFile(filename); |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | // Keys::setKeysFromFile {{{2 | 1396 | // Keys::setKeysFromFile {{{2 |
1397 | void Keys::setKeysFromFile(const char * filename) { | 1397 | void Keys::setKeysFromFile(const char * filename) { |
1398 | 1398 | ||
1399 | QFile f(filename); | 1399 | QFile f(filename); |
1400 | 1400 | ||
1401 | if (f.open(IO_ReadOnly)) { | 1401 | if (f.open(IO_ReadOnly)) { |