Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1430744 into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 336
Merged at revision: 340
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1430744
Merge into: lp:ubuntu-keyboard
Diff against target: 63 lines (+23/-1)
3 files modified
src/plugin/inputmethod.cpp (+2/-0)
src/view/abstracttexteditor.h (+1/-1)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+20/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1430744
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+252613@code.launchpad.net

Commit message

Fix preedit commit when changing layout

Description of the change

Fix preedit commit when changing layout

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/inputmethod.cpp'
2--- src/plugin/inputmethod.cpp 2015-02-09 21:14:15 +0000
3+++ src/plugin/inputmethod.cpp 2015-03-11 17:12:25 +0000
4@@ -544,6 +544,8 @@
5 if (d->activeLanguage == newLanguage)
6 return;
7
8+ d->editor.commitPreedit();
9+
10 setPreviousLanguage(d->activeLanguage);
11 d->activeLanguage = newLanguage;
12 d->host->setLanguage(newLanguage);
13
14=== modified file 'src/view/abstracttexteditor.h'
15--- src/view/abstracttexteditor.h 2015-01-07 15:00:07 +0000
16+++ src/view/abstracttexteditor.h 2015-03-11 17:12:25 +0000
17@@ -112,6 +112,7 @@
18 Logic::AbstractWordEngine * wordEngine() const;
19
20 void checkPreeditReentry(bool uncommittedDelete);
21+ void commitPreedit();
22
23 Q_SLOT void onKeyPressed(const Key &key);
24 Q_SLOT void onKeyReleased(const Key &key);
25@@ -169,7 +170,6 @@
26
27 virtual void singleBackspace();
28
29- void commitPreedit();
30 void removeTrailingWhitespaces();
31 Q_SLOT void autoRepeatBackspace();
32 void autoRepeatWordBackspace();
33
34=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
35--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-02-27 14:12:47 +0000
36+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-03-11 17:12:25 +0000
37@@ -855,6 +855,26 @@
38
39 keyboard.press_key("language")
40
41+ def test_switching_with_preedit(self):
42+ """Switching languages whilst text is in preedit should result in
43+ that text being committed.
44+
45+ """
46+ text_area = self.launch_test_input_area()
47+ self.ensure_focus_on_input(text_area)
48+ keyboard = Keyboard()
49+ self.addCleanup(keyboard.dismiss)
50+
51+ keyboard.type('Hello')
52+
53+ keyboard.press_key("language")
54+
55+ expected = 'Hello'
56+ self.assertThat(
57+ text_area.text,
58+ Eventually(Equals(expected))
59+ )
60+
61
62 def maliit_cleanup():
63 presagedir = os.path.expanduser("~/.presage")

Subscribers

People subscribed via source and target branches