summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp54
-rw-r--r--inputmethods/multikey/keyboard.cpp3
2 files changed, 45 insertions, 12 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index 10bc611..c5ebe3c 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -10,4 +10,2 @@
-#include <iostream.h>
-
#include <qpe/qpeapplication.h>
@@ -64,3 +62,22 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
- keymaps->insertItem(map_dir.absPath() + "/" + map_dir[i]);
+ QFile map (map_dir.absPath() + "/" + map_dir[i]);
+ if (map.open(IO_ReadOnly)) {
+
+ QString line; bool found = 0;
+
+ map.readLine(line, 1024);
+ while (!map.atEnd()) {
+
+ if (line.find(QRegExp("^title\\s*=\\s*")) != -1) {
+
+ keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
+ found = 1;
+ break;
+ }
+ map.readLine(line, 1024);
+ }
+ if (!found) keymaps->insertItem(map_dir.absPath() + "/" + map_dir[i]);
+
+ map.close();
+ }
if (map_dir.absPath() + "/" + map_dir[i] == current_map) {
@@ -87,3 +104,22 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
- keymaps->insertItem(custom_maps[i]);
+ QFile map (custom_maps[i]);
+ if (map.open(IO_ReadOnly)) {
+
+ QString line; bool found = 0;
+
+ map.readLine(line, 1024);
+ while (!map.atEnd()) {
+
+ if (line.find(QRegExp("^title\\s*=\\s*")) != -1) {
+
+ keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
+ found = 1;
+ break;
+ }
+ map.readLine(line, 1024);
+ }
+ if (!found) keymaps->insertItem(custom_maps[i]);
+
+ map.close();
+ }
if (custom_maps[i] == current_map) {
@@ -234,3 +270,3 @@ void ConfigDlg::setMap(int index) {
remove_button->setDisabled(true);
- emit setMapToFile(keymaps->text(index));
+ emit setMapToFile(QPEApplication::qpeDir() + "/share/multikey/" + default_maps[index - 1]);
@@ -239,3 +275,3 @@ void ConfigDlg::setMap(int index) {
remove_button->setEnabled(true);
- emit setMapToFile(keymaps->text(index));
+ emit setMapToFile(custom_maps[index - default_maps.count() - 1]);
}
@@ -254,2 +290,3 @@ void ConfigDlg::addMap() {
maps.append(map);
+ custom_maps.append(map);
keymaps->insertItem(map);
@@ -266,5 +303,2 @@ void ConfigDlg::removeMap() {
- cout << "removing : " << custom_maps[keymaps->currentItem() - default_maps.count() - 1] << "\n";
- cout << "currentItem : " << keymaps->currentItem() << "\n";
-
// move selection up one
@@ -274,3 +308,3 @@ void ConfigDlg::removeMap() {
- custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]);
+ custom_maps.remove(custom_maps.at(keymaps->currentItem() - default_maps.count()));
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 3f6f73b..c3ee8f3 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -36,3 +36,2 @@
#include <qstringlist.h>
-#include <iostream.h>
@@ -604,3 +603,3 @@ void Keyboard::toggleRepeat(bool on) {
useRepeat = on;
- cout << "setting useRepeat to: " << useRepeat << "\n";
+ //cout << "setting useRepeat to: " << useRepeat << "\n";
}