diff options
author | rbuj <[email protected]> | 2022-07-27 10:18:06 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-08-17 02:12:06 +0000 |
commit | f9b6d54be1ecf5dab87a5e7cce66d6771a523e56 (patch) | |
tree | 0464509c1bd3bd0a48409efba1b20c20f86e74b9 /plugins | |
parent | babfbd3a5c53d317631bc5a4b297c466f822e1f6 (diff) | |
download | mate-settings-daemon-f9b6d54be1ecf5dab87a5e7cce66d6771a523e56.tar.bz2 mate-settings-daemon-f9b6d54be1ecf5dab87a5e7cce66d6771a523e56.tar.xz |
msd-keyboard-xkb: use G_N_ELEMENTS macro
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/keyboard/msd-keyboard-xkb.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/keyboard/msd-keyboard-xkb.c b/plugins/keyboard/msd-keyboard-xkb.c index d67db71..31fc298 100644 --- a/plugins/keyboard/msd-keyboard-xkb.c +++ b/plugins/keyboard/msd-keyboard-xkb.c @@ -150,8 +150,7 @@ apply_desktop_settings (void) matekbd_desktop_config_activate (¤t_desktop_config); show_leds = g_settings_get_boolean (settings_desktop, DUPLICATE_LEDS_KEY); - for (i = sizeof (indicator_icons) / sizeof (indicator_icons[0]); - --i >= 0;) { + for (i = G_N_ELEMENTS (indicator_icons); --i >= 0;) { gtk_status_icon_set_visible (indicator_icons[i], show_leds); } @@ -541,8 +540,7 @@ msd_keyboard_update_indicator_icons (void) new_state |= (state ? 1 : 0); xkl_debug (160, "Indicators state: %d\n", new_state); - for (i = sizeof (indicator_icons) / sizeof (indicator_icons[0]); - --i >= 0;) { + for (i = G_N_ELEMENTS (indicator_icons); --i >= 0;) { gtk_status_icon_set_from_icon_name (indicator_icons[i], (new_state & (1 << i)) ? @@ -582,8 +580,7 @@ msd_keyboard_xkb_init (MsdKeyboardManager * kbd_manager) num_lock = XInternAtom (display, "Num Lock", False); scroll_lock = XInternAtom (display, "Scroll Lock", False); - for (i = sizeof (indicator_icons) / sizeof (indicator_icons[0]); - --i >= 0;) { + for (i = G_N_ELEMENTS (indicator_icons); --i >= 0;) { indicator_icons[i] = gtk_status_icon_new_from_icon_name (indicator_off_icon_names[i]); @@ -660,8 +657,7 @@ msd_keyboard_xkb_shutdown (void) pa_callback_user_data = NULL; manager = NULL; - for (i = sizeof (indicator_icons) / sizeof (indicator_icons[0]); - --i >= 0;) { + for (i = G_N_ELEMENTS (indicator_icons); --i >= 0;) { g_object_unref (G_OBJECT (indicator_icons[i])); indicator_icons[i] = NULL; } |