From f64d4fdf43a17dc39132354ffdb1060a185fa715 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Wed, 17 Jul 2013 11:50:25 +0900 Subject: [PATCH] Remove ibus_bus_list_active_engines in bus/test-client.c BUG=http://code.google.com/p/ibus/issues/detail?id=1637 TEST=bus/test-client.c Review URL: https://codereview.appspot.com/11336044 --- bus/test-client.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/bus/test-client.c b/bus/test-client.c index 6192c8f..6abc367 100644 --- a/bus/test-client.c +++ b/bus/test-client.c @@ -35,7 +35,6 @@ static void bus_test_client_class_init (BusTestClientClass *class) static void bus_test_client_destroy (IBusObject *object); /* static methods*/ -static gchar* _get_active_engine_name (void); static void _store_modifier_state (BusTestClient *client, guint modifier); static gboolean _is_shift_set (BusTestClient *client); @@ -83,7 +82,6 @@ static void bus_test_client_init (BusTestClient *client) { IDEBUG ("%s", __FUNCTION__); - gchar *active_engine_name; client->connected = FALSE; client->enabled = FALSE; @@ -104,13 +102,7 @@ bus_test_client_init (BusTestClient *client) client->caps = IBUS_CAP_FOCUS; ibus_input_context_set_capabilities (client->ibuscontext, client->caps); - active_engine_name = _get_active_engine_name (); - - g_return_if_fail (active_engine_name != NULL); - IDEBUG ("engine:%s", active_engine_name); - ibus_input_context_focus_in (client->ibuscontext); - ibus_input_context_set_engine (client->ibuscontext, active_engine_name); - g_free (active_engine_name); + ibus_bus_set_global_engine (_bus, "xkb:us::eng"); client->enabled = TRUE; } @@ -219,32 +211,6 @@ void bus_test_client_clear_modifier (BusTestClient *client) } } -static gchar * -_get_active_engine_name (void) -{ - GList *engines; - gchar *result; - - engines = ibus_bus_list_active_engines (_bus); - if (engines == NULL) { - return NULL; - } - - IBusEngineDesc *engine_desc = IBUS_ENGINE_DESC (engines->data); - if (engine_desc != NULL) { - result = g_strdup (ibus_engine_desc_get_name(engine_desc)); - } else { - result = NULL; - } - - for (; engines != NULL; engines = g_list_next (engines)) { - g_object_unref (IBUS_ENGINE_DESC (engines->data)); - } - g_list_free (engines); - - return result; -} - static void _store_modifier_state (BusTestClient *client, guint modifier) -- 2.7.4