Merge lp:~schwann/ubuntu-keyboard/keyboard-html-enter into lp:ubuntu-keyboard

Proposed by Günter Schwann
Status: Merged
Approved by: Bill Filler
Approved revision: 60
Merged at revision: 62
Proposed branch: lp:~schwann/ubuntu-keyboard/keyboard-html-enter
Merge into: lp:ubuntu-keyboard
Diff against target: 88 lines (+12/-5)
3 files modified
src/lib/logic/wordengine.cpp (+3/-2)
src/plugin/editor.cpp (+4/-0)
src/view/abstracttexteditor.cpp (+5/-3)
To merge this branch: bzr merge lp:~schwann/ubuntu-keyboard/keyboard-html-enter
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
Thomas Moenicke (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+189624@code.launchpad.net

Commit message

Send return ("\r") as text in return key event fixes LP: #1230035

Description of the change

Send return ("\r") as text in return key event fixes LP: #1230035
Fix is in src/view/abstracttexteditor.cpp

Plus some potential compile and crash fixes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

looks good

review: Approve
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lib/logic/wordengine.cpp'
2--- src/lib/logic/wordengine.cpp 2013-09-16 14:28:33 +0000
3+++ src/lib/logic/wordengine.cpp 2013-10-07 14:51:32 +0000
4@@ -183,11 +183,12 @@
5
6 void WordEngine::onWordCandidateSelected(QString word)
7 {
8+#ifdef HAVE_PINYIN
9 Q_D(WordEngine);
10-
11-#ifdef HAVE_PINYIN
12 if (d->predictiveBackend == WordEnginePrivate::PinyinBackend)
13 d->pinyinAdapter->wordCandidateSelected(word);
14+#else
15+ Q_UNUSED(word);
16 #endif
17 }
18
19
20=== modified file 'src/plugin/editor.cpp'
21--- src/plugin/editor.cpp 2013-07-19 12:05:07 +0000
22+++ src/plugin/editor.cpp 2013-10-07 14:51:32 +0000
23@@ -64,6 +64,7 @@
24 if (not m_host) {
25 qWarning() << __PRETTY_FUNCTION__
26 << "Host not set, ignoring.";
27+ return;
28 }
29
30 QList<Maliit::PreeditTextFormat> format_list;
31@@ -83,6 +84,7 @@
32 if (not m_host) {
33 qWarning() << __PRETTY_FUNCTION__
34 << "Host not set, ignoring.";
35+ return;
36 }
37
38 m_host->sendCommitString(commit);
39@@ -93,6 +95,7 @@
40 if (not m_host) {
41 qWarning() << __PRETTY_FUNCTION__
42 << "Host not set, ignoring.";
43+ return;
44 }
45
46 m_host->sendKeyEvent(ev);
47@@ -103,6 +106,7 @@
48 if (not m_host) {
49 qWarning() << __PRETTY_FUNCTION__
50 << "Host not set, ignoring.";
51+ return;
52 }
53
54 m_host->invokeAction(action, sequence);
55
56=== modified file 'src/view/abstracttexteditor.cpp'
57--- src/view/abstracttexteditor.cpp 2013-07-19 12:05:07 +0000
58+++ src/view/abstracttexteditor.cpp 2013-10-07 14:51:32 +0000
59@@ -409,6 +409,7 @@
60 }
61
62 const QString &text(key.label().text());
63+ QString keyText = QString("");
64 Qt::Key event_key = Qt::Key_unknown;
65
66 switch(key.action()) {
67@@ -458,9 +459,10 @@
68 }
69 } break;
70
71- case Key::ActionReturn:
72+ case Key::ActionReturn: {
73 event_key = Qt::Key_Return;
74- break;
75+ keyText = QString("\r");
76+ } break;
77
78 case Key::ActionClose:
79 Q_EMIT keyboardClosed();
80@@ -499,7 +501,7 @@
81
82 if (event_key != Qt::Key_unknown) {
83 commitPreedit();
84- QKeyEvent ev(QEvent::KeyPress, event_key, Qt::NoModifier);
85+ QKeyEvent ev(QEvent::KeyPress, event_key, Qt::NoModifier, keyText);
86 sendKeyEvent(ev);
87 }
88 }

Subscribers

People subscribed via source and target branches