summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/keyz-cfg/zkbnames.cpp3
-rw-r--r--noncore/apps/keyz-cfg/zkbnames.h4
-rw-r--r--noncore/apps/keyz-cfg/zkbxml.cpp14
3 files changed, 0 insertions, 21 deletions
diff --git a/noncore/apps/keyz-cfg/zkbnames.cpp b/noncore/apps/keyz-cfg/zkbnames.cpp
index fec3a2e..c20a114 100644
--- a/noncore/apps/keyz-cfg/zkbnames.cpp
+++ b/noncore/apps/keyz-cfg/zkbnames.cpp
@@ -1,14 +1,12 @@
-#ifdef USE_ZKB_NAMES
-
#include <qmap.h>
#include <qstring.h>
#include "zkbnames.h"
QString Null_String((const char*) 0);
// Implementation of KeyNames
static struct {
int key;
char *name;
} Key_Names[] = {
@@ -438,13 +436,12 @@ const QString& KeycodeNames::find(int k) {
if (kcn_map.isEmpty()) {
init_kcn_maps();
}
QMap<int, QString>::Iterator it = kcn_rmap.find(k);
if (it == kcn_rmap.end()) {
return Null_String;
} else {
return it.data();
}
}
-#endif
diff --git a/noncore/apps/keyz-cfg/zkbnames.h b/noncore/apps/keyz-cfg/zkbnames.h
index 58462ff..0d1e7f5 100644
--- a/noncore/apps/keyz-cfg/zkbnames.h
+++ b/noncore/apps/keyz-cfg/zkbnames.h
@@ -1,27 +1,23 @@
#ifndef ZKBNAMES_H
#define ZKBNAMES_H
-#ifdef USE_ZKB_NAMES
-
#include <qstring.h>
class KeyNames {
public:
static int find(const QString& key);
static const QString& find(int);
};
class KeycodeNames {
public:
static int find(const QString& key);
static const QString& find(int);
};
class ModifierNames {
public:
static int find(const QString& key);
static const QString& find(int);
};
-
-#endif
#endif
diff --git a/noncore/apps/keyz-cfg/zkbxml.cpp b/noncore/apps/keyz-cfg/zkbxml.cpp
index 76472cb..5b0084c 100644
--- a/noncore/apps/keyz-cfg/zkbxml.cpp
+++ b/noncore/apps/keyz-cfg/zkbxml.cpp
@@ -480,93 +480,79 @@ bool ZkbXmlHandler::end_event() {
bool ZkbXmlHandler::end_next_state() {
return endNextStateElement();
}
void ZkbXmlHandler::setError(const QString& e) {
err = e;
}
int ZkbXmlHandler::str2key(const QString& s) {
int ret;
-#ifdef USE_ZKB_NAMES
ret = KeyNames::find(s);
if (ret == -1) {
setError("Invalid value: " + s);
}
-#else
- ret = str2uint(s);
-#endif
-
return ret;
}
int ZkbXmlHandler::str2modifier(const QString& val) {
int ret;
-#ifdef USE_ZKB_NAMES
int n, i;
ret = 0;
n = 0;
do {
i = val.find('|', n);
if (i < 0) {
i = val.length();
}
QString s = val.mid(n, i - n);
int v = ModifierNames::find(s.stripWhiteSpace());
if (v == -1) {
setError("Invalid value: " + val);
return -1;
}
ret |= v;
n = i + 1;
} while (n < val.length());
-#else
- ret = str2uint(val);
-#endif
return ret;
}
bool ZkbXmlHandler::str2bool(const QString& s) {
if (s == "true") {
return true;
} else {
return false;
}
}
int ZkbXmlHandler::str2unicode(const QString& s) {
return str2uint(s);
}
int ZkbXmlHandler::str2keycode(const QString& s) {
int ret;
-#ifdef USE_ZKB_NAMES
ret = KeycodeNames::find(s);
if (ret == -1) {
setError("Invalid value: " + s);
}
-#else
- ret = str2uint(s);
-#endif
-
return ret;
}
int ZkbXmlHandler::str2uint(const QString& s) {
int ret;
bool ok;
QString val = s;
int r;
if (val.left(2) == "0x") {
val = s.mid(2);
r = 16;