keyboard: Turn gchar** into GStrv and use g_auto

This commit is contained in:
Georges Basile Stavracas Neto 2018-03-16 14:18:45 -03:00
parent 4496b60c73
commit ee66dc5f3f
3 changed files with 3 additions and 4 deletions

View file

@ -524,7 +524,7 @@ reload_sections (CcKeyboardManager *self)
GHashTable *loaded_files; GHashTable *loaded_files;
GDir *dir; GDir *dir;
gchar *default_wm_keybindings[] = { "Mutter", "GNOME Shell", NULL }; gchar *default_wm_keybindings[] = { "Mutter", "GNOME Shell", NULL };
gchar **wm_keybindings; g_auto(GStrv) wm_keybindings = NULL;
const gchar * const * data_dirs; const gchar * const * data_dirs;
guint i; guint i;
@ -601,7 +601,6 @@ reload_sections (CcKeyboardManager *self)
} }
g_hash_table_destroy (loaded_files); g_hash_table_destroy (loaded_files);
g_strfreev (wm_keybindings);
/* Load custom keybindings */ /* Load custom keybindings */
append_sections_from_gsettings (self); append_sections_from_gsettings (self);

View file

@ -71,7 +71,7 @@ wm_common_get_current_window_manager (void)
return g_strdup (WM_COMMON_UNKNOWN); return g_strdup (WM_COMMON_UNKNOWN);
} }
char** GStrv
wm_common_get_current_keybindings (void) wm_common_get_current_keybindings (void)
{ {
Atom keybindings_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_GNOME_WM_KEYBINDINGS", False); Atom keybindings_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_GNOME_WM_KEYBINDINGS", False);

View file

@ -7,7 +7,7 @@
/* Returns a strv of keybinding names for the window manager; /* Returns a strv of keybinding names for the window manager;
* using _GNOME_WM_KEYBINDINGS if available, _NET_WM_NAME otherwise. */ * using _GNOME_WM_KEYBINDINGS if available, _NET_WM_NAME otherwise. */
char **wm_common_get_current_keybindings (void); GStrv wm_common_get_current_keybindings (void);
gpointer wm_common_register_window_manager_change (GFunc func, gpointer wm_common_register_window_manager_change (GFunc func,
gpointer data); gpointer data);