From aee3578019040164f1bc5761923f7ece6a77b590 Mon Sep 17 00:00:00 2001 From: ketmar Date: Mon, 16 Jan 2012 13:32:15 +0200 Subject: [PATCH] improved layout parser (it should work better now) --- src/xkeyboard.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/xkeyboard.cpp b/src/xkeyboard.cpp index d607129..f7e853c 100644 --- a/src/xkeyboard.cpp +++ b/src/xkeyboard.cpp @@ -125,7 +125,7 @@ void XKeyboard::groupNames (QStringList &list) { } -// pc+us+ru:2+inet(evdev)+group(menu_toggle) +// pc+us+ru(winkey):2+inet(evdev)+group(menu_toggle) void XKeyboard::symbolNames (QStringList &list) { XErrorHandler oh; XkbDescRec kbd; @@ -156,16 +156,17 @@ void XKeyboard::symbolNames (QStringList &list) { symName = s; // s = symName; + qDebug("symName: [%s]", s); while (*s) { - char *e = s, ch; + char *e = strchr(s, '+'), ch, *t; // - while (*e && *e != '+') ++e; + if (e == NULL) e = s+strlen(s); ch = *e; *e = '\0'; - if (strcasecmp(s, "pc") != 0 && !strchr(s, '(')) { - char *col = strchr(s, ':'); - if (col) *col = '\0'; + if ((t = strchr(s, '(')) != NULL) *t = '\0'; + if ((t = strchr(s, ':')) != NULL) *t = '\0'; + if (strcasecmp(s, "pc") != 0 && strlen(s) == 2) { + qDebug(" found: [%s]", s); list << s; - if (col) *col = ':'; } if (ch) *e++ = ch; s = e; -- 2.11.4.GIT