[gnome-dictionary/ebassi/merge-gdict: 5/7] Avoid shadowing a variable
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dictionary/ebassi/merge-gdict: 5/7] Avoid shadowing a variable
- Date: Thu, 24 Sep 2020 15:54:19 +0000 (UTC)
commit f8ec1dcfdc81bfe962a537208f7a838951376174
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Sep 23 16:07:13 2020 +0100
Avoid shadowing a variable
As we're disconnecting the old GdictContext instance, we shouldn't
shadow the variable with the new one.
src/gdict-window.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/gdict-window.c b/src/gdict-window.c
index 8e7b175..02be31c 100644
--- a/src/gdict-window.c
+++ b/src/gdict-window.c
@@ -302,7 +302,7 @@ gdict_window_error_cb (GdictContext *context,
if (error->code == GDICT_CONTEXT_ERROR_NO_MATCH)
{
GdictSource *source;
- GdictContext *context;
+ GdictContext *source_context;
gdict_window_set_sidebar_visible (window, TRUE);
gdict_sidebar_view_page (GDICT_SIDEBAR (window->sidebar),
@@ -314,18 +314,15 @@ gdict_window_error_cb (GdictContext *context,
*/
source = gdict_source_loader_get_source (window->loader,
window->source_name);
- context = gdict_source_get_context (source);
+ source_context = gdict_source_get_context (source);
- gdict_speller_set_context (GDICT_SPELLER (window->speller),
- context);
- g_object_unref (context);
+ gdict_speller_set_context (GDICT_SPELLER (window->speller), source_context);
+ g_object_unref (source_context);
g_object_unref (source);
- gdict_speller_set_strategy (GDICT_SPELLER (window->speller),
- window->strategy);
+ gdict_speller_set_strategy (GDICT_SPELLER (window->speller), window->strategy);
- gdict_speller_match (GDICT_SPELLER (window->speller),
- window->word);
+ gdict_speller_match (GDICT_SPELLER (window->speller), window->word);
}
/* unset the word and update the UI */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]