summaryrefslogtreecommitdiff
path: root/inputmethods
Unidiff
Diffstat (limited to 'inputmethods') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp23
-rw-r--r--inputmethods/multikey/multikey.pro2
2 files changed, 23 insertions, 2 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index c5ebe3c..f6507b4 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -284,17 +284,38 @@ void ConfigDlg::addMap() {
284 284
285 if (map.isNull()) return; 285 if (map.isNull()) return;
286 286
287 Config config ("multikey"); 287 Config config ("multikey");
288 config.setGroup("keymaps"); 288 config.setGroup("keymaps");
289 QStringList maps = config.readListEntry("maps", QChar('|')); 289 QStringList maps = config.readListEntry("maps", QChar('|'));
290 maps.append(map); 290 maps.append(map);
291 custom_maps.append(map); 291 custom_maps.append(map);
292 keymaps->insertItem(map); 292
293 QFile map_file (map);
294 if (map_file.open(IO_ReadOnly)) {
295
296 QString line; bool found = 0;
297
298 map_file.readLine(line, 1024);
299 while (!map_file.atEnd()) {
300
301 if (line.find(QRegExp("^title\\s*=\\s*")) != -1) {
302
303 keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
304 found = 1;
305 break;
306 }
307 map_file.readLine(line, 1024);
308 }
309 if (!found) keymaps->insertItem(map);
310
311 map_file.close();
312 }
313
293 keymaps->setSelected(keymaps->count() - 1, true); 314 keymaps->setSelected(keymaps->count() - 1, true);
294 315
295 316
296 config.writeEntry("maps", maps, QChar('|')); 317 config.writeEntry("maps", maps, QChar('|'));
297 config.writeEntry("current", map); 318 config.writeEntry("current", map);
298 319
299} 320}
300 321
diff --git a/inputmethods/multikey/multikey.pro b/inputmethods/multikey/multikey.pro
index 9d76a3d..1171602 100644
--- a/inputmethods/multikey/multikey.pro
+++ b/inputmethods/multikey/multikey.pro
@@ -6,17 +6,17 @@ HEADERS = keyboard.h \
6 ../pickboard/pickboardpicks.h \ 6 ../pickboard/pickboardpicks.h \
7 keyboardimpl.h 7 keyboardimpl.h
8 SOURCES= keyboard.cpp \ 8 SOURCES= keyboard.cpp \
9 configdlg.cpp \ 9 configdlg.cpp \
10 ../pickboard/pickboardcfg.cpp \ 10 ../pickboard/pickboardcfg.cpp \
11 ../pickboard/pickboardpicks.cpp \ 11 ../pickboard/pickboardpicks.cpp \
12 keyboardimpl.cpp 12 keyboardimpl.cpp
13 TARGET = qmultikey 13 TARGET = qmultikey
14 DESTDIR = ../../plugins/inputmethods 14 DESTDIR = $(OPIEDIR)/plugins/inputmethods
15INCLUDEPATH += $(OPIEDIR)/include 15INCLUDEPATH += $(OPIEDIR)/include
16DEPENDPATH += ../$(OPIEDIR)/include ../../launcher 16DEPENDPATH += ../$(OPIEDIR)/include ../../launcher
17LIBS += -lqpe 17LIBS += -lqpe
18 VERSION = 1.0.0 18 VERSION = 1.0.0
19 19
20TRANSLATIONS = ../../i18n/pt_BR/libqmultikey.ts 20TRANSLATIONS = ../../i18n/pt_BR/libqmultikey.ts
21TRANSLATIONS += ../../i18n/de/libqmultikey.ts 21TRANSLATIONS += ../../i18n/de/libqmultikey.ts
22TRANSLATIONS += ../../i18n/en/libqmultikey.ts 22TRANSLATIONS += ../../i18n/en/libqmultikey.ts