Remove fake support for global group range settings
authorRan Benita <ran234@gmail.com>
Wed, 23 May 2012 18:24:50 +0000 (21:24 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 4 Jun 2012 12:05:24 +0000 (13:05 +0100)
A symbols file may contain a global, non key specific setting for
the group out-of-range handling method (wrap, clamp, redirect). Only
that:

* Its parsed and kept in the SymbolsInfo, but is not otherwise used in
  any way (it's the same in the real xkbcomp).
* It's not used in any of xkeyboard-config files.
* It's not mentioned in the xkb specs (only the per-key ones).
* It doesn't make much sense anyway.

So remove the struct field, and emit an "unsupported, ignored" warning.
We don't increment the error count because of it, just continue (the
radio group warning just below is changed to do the same - there's no
reason to possibly abort the entire thing for it).

Signed-off-by: Ran Benita <ran234@gmail.com>
Conflicts:

src/xkbcomp/symbols.c

src/xkbcomp/symbols.c

index dce840b..9a3e73f 100644 (file)
@@ -265,7 +265,6 @@ typedef struct _SymbolsInfo
     unsigned fileID;
     unsigned merge;
     unsigned explicit_group;
-    unsigned groupInfo;
     darray(KeyInfo) keys;
     KeyInfo dflt;
     VModInfo vmods;
@@ -286,7 +285,6 @@ InitSymbolsInfo(SymbolsInfo * info, struct xkb_keymap *keymap)
     info->errorCount = 0;
     info->fileID = 0;
     info->merge = MergeOverride;
-    info->groupInfo = 0;
     darray_init(info->keys);
     darray_growalloc(info->keys, SYMBOLS_INIT_SIZE);
     info->modMap = NULL;
@@ -1357,7 +1355,7 @@ SetGroupName(SymbolsInfo *info, struct xkb_keymap *keymap, ExprDef *arrayNdx,
 static int
 HandleSymbolsVar(VarDef *stmt, struct xkb_keymap *keymap, SymbolsInfo *info)
 {
-    ExprResult elem, field, tmp;
+    ExprResult elem, field;
     ExprDef *arrayNdx;
     bool ret;
 
@@ -1378,59 +1376,31 @@ HandleSymbolsVar(VarDef *stmt, struct xkb_keymap *keymap, SymbolsInfo *info)
              && ((strcasecmp(field.str, "groupswrap") == 0) ||
                  (strcasecmp(field.str, "wrapgroups") == 0)))
     {
-        if (!ExprResolveBoolean(keymap->ctx, stmt->value, &tmp))
-        {
-            ERROR("Illegal setting for global groupsWrap\n");
-            ACTION("Non-boolean value ignored\n");
-            ret = false;
-        }
-        else {
-            if (tmp.uval)
-                info->groupInfo = XkbWrapIntoRange;
-            else
-                info->groupInfo = XkbClampIntoRange;
-            ret = true;
-        }
+        ERROR("Global \"groupswrap\" not supported\n");
+        ACTION("Ignored\n");
+        ret = true;
     }
     else if ((elem.str == NULL)
              && ((strcasecmp(field.str, "groupsclamp") == 0) ||
                  (strcasecmp(field.str, "clampgroups") == 0)))
     {
-        if (!ExprResolveBoolean(keymap->ctx, stmt->value, &tmp))
-        {
-            ERROR("Illegal setting for global groupsClamp\n");
-            ACTION("Non-boolean value ignored\n");
-            return false;
-        }
-        else {
-            if (tmp.uval)
-                info->groupInfo = XkbClampIntoRange;
-            else
-                info->groupInfo = XkbWrapIntoRange;
-            ret = true;
-        }
+        ERROR("Global \"groupsclamp\" not supported\n");
+        ACTION("Ignored\n");
+        ret = true;
     }
     else if ((elem.str == NULL)
              && ((strcasecmp(field.str, "groupsredirect") == 0) ||
                  (strcasecmp(field.str, "redirectgroups") == 0)))
     {
-        if (!ExprResolveGroup(keymap->ctx, stmt->value, &tmp))
-        {
-            ERROR("Illegal group index for global groupsRedirect\n");
-            ACTION("Definition with non-integer group ignored\n");
-            ret = false;
-        }
-        else {
-            info->groupInfo = XkbSetGroupInfo(0, XkbRedirectIntoRange,
-                                              tmp.uval);
-            ret = true;
-        }
+        ERROR("Global \"groupsredirect\" not supported\n");
+        ACTION("Ignored\n");
+        ret = true;
     }
     else if ((elem.str == NULL) && (strcasecmp(field.str, "allownone") == 0))
     {
         ERROR("Radio groups not supported\n");
-        ACTION("Ignoring \"allow none\" specification\n");
-        ret = false;
+        ACTION("Ignoring \"allownone\" specification\n");
+        ret = true;
     }
     else {
         ret = SetActionField(keymap, elem.str, field.str, arrayNdx,