summaryrefslogtreecommitdiff
path: root/noncore/apps/keyz-cfg/zkbcfg.cpp
Unidiff
Diffstat (limited to 'noncore/apps/keyz-cfg/zkbcfg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/keyz-cfg/zkbcfg.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/keyz-cfg/zkbcfg.cpp b/noncore/apps/keyz-cfg/zkbcfg.cpp
index f1d53ba..24bd897 100644
--- a/noncore/apps/keyz-cfg/zkbcfg.cpp
+++ b/noncore/apps/keyz-cfg/zkbcfg.cpp
@@ -10,25 +10,25 @@ using namespace Opie::Core;
10// Implementation of XkbConfig class 10// Implementation of XkbConfig class
11ZkbConfig::ZkbConfig(const QString& dir):path(dir) { 11ZkbConfig::ZkbConfig(const QString& dir):path(dir) {
12} 12}
13 13
14ZkbConfig::~ZkbConfig() { 14ZkbConfig::~ZkbConfig() {
15} 15}
16 16
17bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { 17bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) {
18 bool ret; 18 bool ret;
19 QFile f(path+"/"+file); 19 QFile f(path+"/"+file);
20 QFileInfo fi(f); 20 QFileInfo fi(f);
21 21
22 odebug << "start loading file=" << (const char*) file.utf8() << "\n" << oendl; 22 odebug << "start loading file=" << file.utf8() << "\n" << oendl;
23 if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { 23 if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) {
24 return false; 24 return false;
25 } 25 }
26 26
27 includedFiles.insert(fi.absFilePath(), 1); 27 includedFiles.insert(fi.absFilePath(), 1);
28 QXmlInputSource is(f); 28 QXmlInputSource is(f);
29 QXmlSimpleReader reader; 29 QXmlSimpleReader reader;
30 ZkbHandler h(*this, keymap, prefix); 30 ZkbHandler h(*this, keymap, prefix);
31 31
32 reader.setContentHandler(&h); 32 reader.setContentHandler(&h);
33 reader.setErrorHandler(this); 33 reader.setErrorHandler(this);
34 ret = reader.parse(is); 34 ret = reader.parse(is);
@@ -116,25 +116,25 @@ bool ZkbHandler::startLabelElement(const QString& label,
116 return false; 116 return false;
117 } 117 }
118 118
119 return true; 119 return true;
120} 120}
121 121
122bool ZkbHandler::startStateElement(const QString& name, 122bool ZkbHandler::startStateElement(const QString& name,
123 const QString& parentName, bool dflt) { 123 const QString& parentName, bool dflt) {
124 124
125 currentStateName = prefix + name; 125 currentStateName = prefix + name;
126 currentState = keymap.getStateByName(currentStateName); 126 currentState = keymap.getStateByName(currentStateName);
127 127
128 //odebug << "state name=" << (const char*) currentStateName.utf8() << "\n" << oendl; 128 //odebug << "state name=" << currentStateName.utf8() << "\n" << oendl;
129 129
130 State* parent = 0; 130 State* parent = 0;
131 if (!parentName.isEmpty()) { 131 if (!parentName.isEmpty()) {
132 QString pn = prefix + parentName; 132 QString pn = prefix + parentName;
133 parent = keymap.getStateByName(pn); 133 parent = keymap.getStateByName(pn);
134 if (parent == 0) { 134 if (parent == 0) {
135 err = currentStateName + 135 err = currentStateName +
136 ": undefined parent state: " + pn; 136 ": undefined parent state: " + pn;
137 return false; 137 return false;
138 } 138 }
139 } 139 }
140 140