Also print group name in keysym error
authorDaniel Stone <daniel@fooishbar.org>
Fri, 16 Mar 2012 14:27:39 +0000 (14:27 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Fri, 16 Mar 2012 14:29:40 +0000 (14:29 +0000)
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>
src/xkbcomp/symbols.c

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