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

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 292
Merged at revision: 299
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1415881
Merge into: lp:ubuntu-keyboard
Diff against target: 20 lines (+4/-1)
1 file modified
src/plugin/inputmethod.cpp (+4/-1)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1415881
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+247985@code.launchpad.net

Commit message

Fix autocaps for clients that send multiline surrounding text

Description of the change

Fix autocaps for clients that send multiline surrounding text

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 changes

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

 * No changes

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

 * No changes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (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-01-16 17:41:14 +0000
3+++ src/plugin/inputmethod.cpp 2015-01-29 14:02:02 +0000
4@@ -446,12 +446,15 @@
5 int position;
6 bool ok = d->host->surroundingText(text, position);
7 QString textOnLeft = d->editor.text()->surroundingLeft() + d->editor.text()->preedit();
8+ if (textOnLeft.contains("\n")) {
9+ textOnLeft = textOnLeft.split("\n").last();
10+ }
11 QStringList leftHandWords = textOnLeft.split(" ");
12 bool email_detected = false;
13 if (!leftHandWords.isEmpty() && leftHandWords.last().contains("@")) {
14 email_detected = true;
15 }
16- if (ok && !email_detected && ((text.isEmpty() && d->editor.text()->preedit().isEmpty() && position == 0)
17+ if (ok && !email_detected && ((textOnLeft.isEmpty() && d->editor.text()->preedit().isEmpty())
18 || d->editor.wordEngine()->languageFeature()->activateAutoCaps(textOnLeft)
19 || d->editor.wordEngine()->languageFeature()->activateAutoCaps(textOnLeft.trimmed()))) {
20 Q_EMIT activateAutocaps();

Subscribers

People subscribed via source and target branches