}
bool
-BindIndicators(struct xkb_keymap *keymap, bool force, LEDInfo *unbound,
- LEDInfo **unboundRtrn)
+BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound, LEDInfo **unboundRtrn)
{
int i;
LEDInfo *led, *next, *last;
}
}
}
- if (force)
+ for (led = unbound; led != NULL; led = (LEDInfo *) led->defs.next)
{
- for (led = unbound; led != NULL; led = (LEDInfo *) led->defs.next)
+ if (led->indicator == _LED_NotBound)
{
- if (led->indicator == _LED_NotBound)
+ for (i = 0; i < XkbNumIndicators; i++)
{
- for (i = 0; i < XkbNumIndicators; i++)
+ if (keymap->names->indicators[i] == NULL)
{
- if (keymap->names->indicators[i] == NULL)
- {
- keymap->names->indicators[i] =
- xkb_atom_strdup(keymap->ctx, led->name);
- led->indicator = i + 1;
- break;
- }
- }
- if (led->indicator == _LED_NotBound)
- {
- ERROR("No unnamed indicators found\n");
- ACTION
- ("Virtual indicator map \"%s\" not bound\n",
- xkb_atom_text(keymap->ctx, led->name));
- continue;
+ keymap->names->indicators[i] =
+ xkb_atom_strdup(keymap->ctx, led->name);
+ led->indicator = i + 1;
+ break;
}
}
+ if (led->indicator == _LED_NotBound)
+ {
+ ERROR("No unnamed indicators found\n");
+ ACTION
+ ("Virtual indicator map \"%s\" not bound\n",
+ xkb_atom_text(keymap->ctx, led->name));
+ continue;
+ }
}
}
}
next = (LEDInfo *) led->defs.next;
if (led->indicator == _LED_NotBound)
{
- if (force)
- {
- unbound = next;
- free(led);
- }
- else
- {
- if (last)
- last->defs.next = &led->defs;
- else
- unbound = led;
- last = led;
- }
+ unbound = next;
+ free(led);
}
else
{
ACTION("Using %s, ignoring %s\n", old,
xkb_atom_text(keymap->ctx, led->name));
led->indicator = _LED_NotBound;
- if (force)
- {
- free(led);
- unbound = next;
- }
- else
- {
- if (last)
- last->defs.next = &led->defs;
- else
- unbound = led;
- last = led;
- }
+ unbound = next;
+ free(led);
}
else
{