diff options
author | raveit65 <[email protected]> | 2016-05-29 23:58:26 +0200 |
---|---|---|
committer | monsta <[email protected]> | 2016-08-12 17:12:16 +0300 |
commit | 15eeea937a24b5ea097614171b60536e9dce48bd (patch) | |
tree | f9c8518568d873d3f30bb93ed07080c5a4577804 /mate-dictionary/libgdict | |
parent | 0fcdfec6179aafb81c667d08c5fcd27e574b714f (diff) | |
download | mate-utils-15eeea937a24b5ea097614171b60536e9dce48bd.tar.bz2 mate-utils-15eeea937a24b5ea097614171b60536e9dce48bd.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')
-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; |