Also print group name in keysym error

Unfortunately we can't get the actual file it was defined in this far
down, but at least give the human-readable name rather than just a group
index.

Also, groups are not zero-indexed, such that index 0 is group 1; fix
that too.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-03-16 14:27:39 +00:00
parent 7dbd304021
commit 3d31be5f87
1 changed files with 7 additions and 6 deletions

View File

@ -899,14 +899,14 @@ AddSymbolsToKey(KeyInfo * key,
if (value->op != ExprKeysymList) if (value->op != ExprKeysymList)
{ {
ERROR("Expected a list of symbols, found %s\n", exprOpText(value->op)); ERROR("Expected a list of symbols, found %s\n", exprOpText(value->op));
ACTION("Ignoring symbols for group %d of %s\n", ndx, ACTION("Ignoring symbols for group %d of %s\n", ndx + 1,
longText(key->name)); longText(key->name));
return False; return False;
} }
if (key->syms[ndx] != NULL) if (key->syms[ndx] != NULL)
{ {
ERROR("Symbols for key %s, group %d already defined\n", ERROR("Symbols for key %s, group %d already defined\n",
longText(key->name), ndx); longText(key->name), ndx + 1);
ACTION("Ignoring duplicate definition\n"); ACTION("Ignoring duplicate definition\n");
return False; return False;
} }
@ -914,16 +914,17 @@ AddSymbolsToKey(KeyInfo * key,
if (((key->numLevels[ndx] < nSyms) || (key->syms[ndx] == NULL)) && if (((key->numLevels[ndx] < nSyms) || (key->syms[ndx] == NULL)) &&
(!ResizeKeyGroup(key, ndx, nSyms, False))) (!ResizeKeyGroup(key, ndx, nSyms, False)))
{ {
WSGO("Could not resize group %d of key %s to contain %d levels\n", ndx, WSGO("Could not resize group %d of key %s to contain %d levels\n",
longText(key->name), nSyms); ndx + 1, longText(key->name), nSyms);
ACTION("Symbols lost\n"); ACTION("Symbols lost\n");
return False; return False;
} }
key->symsDefined |= (1 << ndx); key->symsDefined |= (1 << ndx);
for (i = 0; i < nSyms; i++) { for (i = 0; i < nSyms; i++) {
if (!LookupKeysym(value->value.list.syms[i], &key->syms[ndx][i])) { if (!LookupKeysym(value->value.list.syms[i], &key->syms[ndx][i])) {
WARN("Could not resolve keysym %s for key %s, group %d, level %d\n", WARN("Could not resolve keysym %s for key %s, group %d (%s), level %d\n",
value->value.list.syms[i], longText(key->name), ndx, nSyms); value->value.list.syms[i], longText(key->name), ndx + 1,
XkbcAtomText(info->groupNames[ndx]), nSyms);
key->syms[ndx][i] = NoSymbol; key->syms[ndx][i] = NoSymbol;
} }
} }