Skip to content

Commit

Permalink
Don't register candidates signal handlers more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Dec 29, 2011
1 parent acbad04 commit b54c325
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/engine.vala
Expand Up @@ -134,6 +134,12 @@ class SkkEngine : IBus.Engine {
context.notify["input-mode"].connect ((s, p) => { context.notify["input-mode"].connect ((s, p) => {
update_input_mode (); update_input_mode ();
}); });
context.candidates.populated.connect (() => {
populate_lookup_table ();
});
context.candidates.notify["cursor-pos"].connect (() => {
set_lookup_table_cursor_pos ();
});
update_candidates (); update_candidates ();
update_input_mode (); update_input_mode ();
context.retrieve_surrounding_text.connect (_retrieve_surrounding_text); context.retrieve_surrounding_text.connect (_retrieve_surrounding_text);
Expand Down Expand Up @@ -181,8 +187,8 @@ class SkkEngine : IBus.Engine {
update_auxiliary_text (empty_text, false); update_auxiliary_text (empty_text, false);
} }
} else { } else {
update_lookup_table (lookup_table, false); hide_lookup_table ();
update_auxiliary_text (empty_text, false); hide_auxiliary_text ();
} }
} }


Expand All @@ -203,12 +209,6 @@ class SkkEngine : IBus.Engine {
} }


void update_candidates () { void update_candidates () {
context.candidates.populated.connect (() => {
populate_lookup_table ();
});
context.candidates.notify["cursor-pos"].connect (() => {
set_lookup_table_cursor_pos ();
});
populate_lookup_table (); populate_lookup_table ();
set_lookup_table_cursor_pos (); set_lookup_table_cursor_pos ();
} }
Expand Down

0 comments on commit b54c325

Please sign in to comment.