ivi-shell: remove ivi_shell_setting

it has only developermode option parameter.
The parameter is only used in init_ivi_shell.
Therefore, we can basically remove the struct,
and check the option locally in the function.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Emre Ucan 2018-01-25 14:37:38 +01:00 committed by Pekka Paalanen
parent 0c1bbb9e52
commit f85bf152c1

View File

@ -67,11 +67,6 @@ struct ivi_shell_surface
struct wl_list link; struct wl_list link;
}; };
struct ivi_shell_setting
{
int developermode;
};
/* /*
* Implementation of ivi_surface * Implementation of ivi_surface
*/ */
@ -384,16 +379,24 @@ terminate_binding(struct weston_keyboard *keyboard, const struct timespec *time,
} }
static void static void
init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell, init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell)
const struct ivi_shell_setting *setting)
{ {
struct weston_config *config = wet_get_config(compositor);
struct weston_config_section *section;
int developermode;
shell->compositor = compositor; shell->compositor = compositor;
wl_list_init(&shell->ivi_surface_list); wl_list_init(&shell->ivi_surface_list);
weston_layer_init(&shell->input_panel_layer, compositor); weston_layer_init(&shell->input_panel_layer, compositor);
if (setting->developermode) { section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
weston_config_section_get_bool(section, "developermode",
&developermode, 0);
if (developermode) {
weston_install_debug_key_binding(compositor, MODIFIER_SUPER); weston_install_debug_key_binding(compositor, MODIFIER_SUPER);
weston_compositor_add_key_binding(compositor, KEY_BACKSPACE, weston_compositor_add_key_binding(compositor, KEY_BACKSPACE,
@ -403,23 +406,6 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell,
} }
} }
static int
ivi_shell_setting_create(struct ivi_shell_setting *dest,
struct weston_compositor *compositor,
int *argc, char *argv[])
{
int result = 0;
struct weston_config *config = wet_get_config(compositor);
struct weston_config_section *section;
section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
weston_config_section_get_bool(section, "developermode",
&dest->developermode, 0);
return result;
}
static void static void
activate_binding(struct weston_seat *seat, activate_binding(struct weston_seat *seat,
struct weston_view *focus_view) struct weston_view *focus_view)
@ -483,17 +469,13 @@ wet_shell_init(struct weston_compositor *compositor,
int *argc, char *argv[]) int *argc, char *argv[])
{ {
struct ivi_shell *shell; struct ivi_shell *shell;
struct ivi_shell_setting setting = { };
int retval = -1; int retval = -1;
shell = zalloc(sizeof *shell); shell = zalloc(sizeof *shell);
if (shell == NULL) if (shell == NULL)
return -1; return -1;
if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0) init_ivi_shell(compositor, shell);
return -1;
init_ivi_shell(compositor, shell, &setting);
shell->destroy_listener.notify = shell_destroy; shell->destroy_listener.notify = shell_destroy;
wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);