From 260dc3fddd81d55369eff73da602aa5b6539f06d Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 18 Aug 2011 12:16:39 +0900 Subject: [PATCH] Fix example/simple-client. --- examples/simple-client/main.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/examples/simple-client/main.c b/examples/simple-client/main.c index 0d215b37..9a2aaffa 100644 --- a/examples/simple-client/main.c +++ b/examples/simple-client/main.c @@ -147,31 +147,11 @@ main (int argc, char **argv) eekboard_eekboard_push_context (eekboard, context, NULL); if (opt_set_keyboard) { - GFile *file; - GFileInputStream *input; - EekLayout *layout; - EekKeyboard *keyboard; guint keyboard_id; - file = g_file_new_for_path (opt_set_keyboard); - - error = NULL; - input = g_file_read (file, NULL, &error); - if (error) { - g_printerr ("Can't read file %s: %s\n", - opt_set_keyboard, error->message); - retval = 1; - goto out; - } - - layout = eek_xml_layout_new (G_INPUT_STREAM(input)); - g_object_unref (input); - keyboard = eek_keyboard_new (layout, 640, 480); - g_object_unref (layout); - - keyboard_id = eekboard_context_add_keyboard (context, keyboard, NULL); - g_object_unref (keyboard); - + keyboard_id = eekboard_context_add_keyboard (context, + opt_set_keyboard, + NULL); eekboard_context_set_keyboard (context, keyboard_id, NULL); }