text-backend: Use new config parser

This commit is contained in:
Kristian Høgsberg
2013-05-23 21:45:51 -04:00
parent 673a889fd8
commit 00fd7b82f0
+6 -18
View File
@@ -909,25 +909,13 @@ handle_seat_created(struct wl_listener *listener,
static void static void
text_backend_configuration(struct text_backend *text_backend) text_backend_configuration(struct text_backend *text_backend)
{ {
int config_fd; struct weston_config_section *section;
char *path = NULL;
struct config_key input_method_keys[] = { section = weston_config_get_section(text_backend->compositor->config,
{ "path", CONFIG_KEY_STRING, &path } "input-method", NULL, NULL);
}; weston_config_section_get_string(section, "path",
&text_backend->input_method.path,
struct config_section cs[] = { LIBEXECDIR "/weston-keyboard");
{ "input-method", input_method_keys, ARRAY_LENGTH(input_method_keys), NULL }
};
config_fd = open_config_file("weston.ini");
parse_config_file(config_fd, cs, ARRAY_LENGTH(cs), text_backend);
close(config_fd);
if (path)
text_backend->input_method.path = path;
else
text_backend->input_method.path = strdup(LIBEXECDIR "/weston-keyboard");
} }
static void static void