diff options
author | raveit65 <[email protected]> | 2016-05-29 23:58:26 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-05-30 17:33:02 +0200 |
commit | 2347a5e66d2b986932631e862ea3fc8b987d5b0b (patch) | |
tree | 24ce4be0ad2be0c0c54344cc4e0eb02d53940211 /mate-dictionary/libgdict/gdict-client-context.c | |
parent | f9b45e265b9371b5a857c3aafa5d68d8394ad0be (diff) | |
download | mate-utils-2347a5e66d2b986932631e862ea3fc8b987d5b0b.tar.bz2 mate-utils-2347a5e66d2b986932631e862ea3fc8b987d5b0b.tar.xz |
libgdict: fix emission of lookup-start
Emit lookup-start at the beginning of every lookup command instead of
after receiving response from server.
https://bugzilla.gnome.org/show_bug.cgi?id=537807
taken from:
https://git.gnome.org/browse/gnome-dictionary/commit/?id=4bf5701
Diffstat (limited to 'mate-dictionary/libgdict/gdict-client-context.c')
-rw-r--r-- | mate-dictionary/libgdict/gdict-client-context.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/mate-dictionary/libgdict/gdict-client-context.c b/mate-dictionary/libgdict/gdict-client-context.c index 118a0d91..af13e800 100644 --- a/mate-dictionary/libgdict/gdict-client-context.c +++ b/mate-dictionary/libgdict/gdict-client-context.c @@ -1395,8 +1395,6 @@ gdict_client_context_parse_line (GdictClientContext *context, p = g_utf8_next_char (p); GDICT_NOTE (DICT, "server replied: %d databases found", atoi (p)); - - g_signal_emit_by_name (context, "lookup-start"); } else if (0 == strcmp (buffer, ".")) priv->command->state = S_FINISH; @@ -1447,8 +1445,6 @@ gdict_client_context_parse_line (GdictClientContext *context, p = g_utf8_next_char (p); GDICT_NOTE (DICT, "server replied: %d strategies found", atoi (p)); - - g_signal_emit_by_name (context, "lookup-start"); } else if (0 == strcmp (buffer, ".")) priv->command->state = S_FINISH; @@ -1502,8 +1498,6 @@ gdict_client_context_parse_line (GdictClientContext *context, priv->command->data = def; priv->command->data_destroy = (GDestroyNotify) gdict_definition_unref; - - g_signal_emit_by_name (context, "lookup-start"); } else if (priv->status_code == GDICT_STATUS_WORD_DB_NAME) { @@ -1611,8 +1605,6 @@ gdict_client_context_parse_line (GdictClientContext *context, p = g_utf8_next_char (p); GDICT_NOTE (DICT, "server replied: %d matches found", atoi (p)); - - g_signal_emit_by_name (context, "lookup-start"); } else if (0 == strcmp (buffer, ".")) priv->command->state = S_FINISH; @@ -2046,6 +2038,8 @@ gdict_client_context_get_databases (GdictContext *context, client_ctx = GDICT_CLIENT_CONTEXT (context); + g_signal_emit_by_name (context, "lookup-start"); + if (!gdict_client_context_is_connected (client_ctx)) { GError *connect_error = NULL; @@ -2053,6 +2047,8 @@ gdict_client_context_get_databases (GdictContext *context, gdict_client_context_connect (client_ctx, &connect_error); if (connect_error) { + g_signal_emit_by_name (context, "lookup-end"); + g_propagate_error (error, connect_error); return FALSE; @@ -2075,6 +2071,8 @@ gdict_client_context_get_strategies (GdictContext *context, client_ctx = GDICT_CLIENT_CONTEXT (context); + g_signal_emit_by_name (context, "lookup-start"); + if (!gdict_client_context_is_connected (client_ctx)) { GError *connect_error = NULL; @@ -2082,6 +2080,8 @@ gdict_client_context_get_strategies (GdictContext *context, gdict_client_context_connect (client_ctx, &connect_error); if (connect_error) { + g_signal_emit_by_name (context, "lookup-end"); + g_propagate_error (error, connect_error); return FALSE; @@ -2106,6 +2106,8 @@ gdict_client_context_define_word (GdictContext *context, client_ctx = GDICT_CLIENT_CONTEXT (context); + g_signal_emit_by_name (context, "lookup-start"); + if (!gdict_client_context_is_connected (client_ctx)) { GError *connect_error = NULL; @@ -2113,6 +2115,8 @@ gdict_client_context_define_word (GdictContext *context, gdict_client_context_connect (client_ctx, &connect_error); if (connect_error) { + g_signal_emit_by_name (context, "lookup-end"); + g_propagate_error (error, connect_error); return FALSE; @@ -2140,6 +2144,8 @@ gdict_client_context_match_word (GdictContext *context, client_ctx = GDICT_CLIENT_CONTEXT (context); + g_signal_emit_by_name (context, "lookup-start"); + if (!gdict_client_context_is_connected (client_ctx)) { GError *connect_error = NULL; @@ -2147,6 +2153,8 @@ gdict_client_context_match_word (GdictContext *context, gdict_client_context_connect (client_ctx, &connect_error); if (connect_error) { + g_signal_emit_by_name (context, "lookup-end"); + g_propagate_error (error, connect_error); return FALSE; |