kbdA11yDialog: Avoid unnecessary ternary operators

A condition is already boolean, there's no point in explicitly
turning it into true/false.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710
This commit is contained in:
Florian Müllner 2019-08-19 21:22:20 +02:00 committed by Florian Müllner
parent 52f85c9465
commit fc964f975a

View File

@ -27,7 +27,7 @@ class KbdA11yDialog extends GObject.Object {
if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) { if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) {
key = KEY_SLOW_KEYS_ENABLED; key = KEY_SLOW_KEYS_ENABLED;
enabled = (newFlags & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) ? true : false; enabled = (newFlags & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) > 0;
title = enabled ? title = enabled ?
_("Slow Keys Turned On") : _("Slow Keys Turned On") :
_("Slow Keys Turned Off"); _("Slow Keys Turned Off");
@ -36,7 +36,7 @@ class KbdA11yDialog extends GObject.Object {
} else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) { } else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) {
key = KEY_STICKY_KEYS_ENABLED; key = KEY_STICKY_KEYS_ENABLED;
enabled = (newFlags & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) ? true : false; enabled = (newFlags & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) > 0;
title = enabled ? title = enabled ?
_("Sticky Keys Turned On") : _("Sticky Keys Turned On") :
_("Sticky Keys Turned Off"); _("Sticky Keys Turned Off");