Merge lp:~thomas-moenicke/phablet-extras/maliit-plugins-layout-context into lp:phablet-extras/maliit-plugins

Proposed by Thomas Moenicke
Status: Merged
Approved by: Bill Filler
Approved revision: 2148
Merged at revision: 2135
Proposed branch: lp:~thomas-moenicke/phablet-extras/maliit-plugins-layout-context
Merge into: lp:phablet-extras/maliit-plugins
Diff against target: 1131 lines (+702/-88)
18 files modified
debian/changelog (+1/-1)
maliit-keyboard/data/languages/url.xml (+484/-0)
maliit-keyboard/lib/logic/keyareaconverter.cpp (+1/-0)
maliit-keyboard/lib/logic/layoutupdater.cpp (+3/-8)
maliit-keyboard/lib/models/wordribbon.cpp (+2/-2)
maliit-keyboard/lib/models/wordribbon.h (+1/-1)
maliit-keyboard/maliit-keyboard.pro (+1/-0)
maliit-keyboard/plugin/inputmethod.cpp (+31/-65)
maliit-keyboard/plugin/inputmethod.h (+1/-2)
maliit-keyboard/qml/Keyboard.qml (+5/-2)
maliit-keyboard/tests/common/inputmethodhostprobe.cpp (+15/-0)
maliit-keyboard/tests/common/inputmethodhostprobe.h (+5/-2)
maliit-keyboard/tests/editor/editor.pro (+5/-4)
maliit-keyboard/tests/tests.pro (+2/-1)
maliit-keyboard/tests/wordengine/.bzrignore (+4/-0)
maliit-keyboard/tests/wordengine/main.cpp (+114/-0)
maliit-keyboard/tests/wordengine/wordengine.pro (+16/-0)
unittests.sh (+11/-0)
To merge this branch: bzr merge lp:~thomas-moenicke/phablet-extras/maliit-plugins-layout-context
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+175228@code.launchpad.net

Commit message

support for inputmethod hints: ImhNoPredictiveText implemented
switching wordribbon on/off at runtime

Description of the change

support for inputmethod hints: ImhNoPredictiveText implemented
switching wordribbon on/off at runtime

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

fix merge conflict

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2140. By Thomas Moenicke

fixed a race condition that could crash the plugin when wordengine was enabled
changed debian package dependency to 0.99 (instead of 0.99+git...)

Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

tested on GN

Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

in order to not see an empty word ribbon, we should enable the word engine in the settings file:
https://code.launchpad.net/~thomas-moenicke/phablet-extras/maliit-framework-wordengine-on/+merge/175813

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 :

tested again, downloaded these jenkins packages and flashed the phone with -b
also, /etc/xdg/maliit.org/server.conf needs to set wordeninge to true:

pluginsettings\libmaliit-keyboard-plugin.so\word_engine_enabled = true

Notepad shows wordribbon, while browser does not: Qt.ImhNoPredicitveText flag is set

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

get rid of the changelog entry that bumps the version because we can't release this until the new maliit-framework gets released as it only works with the new maliit-framework. But we can merge it if we remove the changelog entry. Seems to work well with the new maliit-framework but incorrectly shows a blank word ribbon bar with the old framework when predictive text is disabled.

review: Needs Fixing
2141. By Thomas Moenicke

remove changelog bump

Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

done

it should work with both maliit-framework verions as I changed the version
check to this:
Depends: maliit-framework (>= 0.99),

Anyways I removed it

On Mon, Jul 22, 2013 at 6:47 PM, Bill Filler <email address hidden>wrote:

> Review: Needs Fixing
>
> get rid of the changelog entry that bumps the version because we can't
> release this until the new maliit-framework gets released as it only works
> with the new maliit-framework. But we can merge it if we remove the
> changelog entry. Seems to work well with the new maliit-framework but
> incorrectly shows a blank word ribbon bar with the old framework when
> predictive text is disabled.
> --
>
> https://code.launchpad.net/~thomas-moenicke/phablet-extras/maliit-plugins-layout-context/+merge/175228
> You are the owner of
> lp:~thomas-moenicke/phablet-extras/maliit-plugins-layout-context.
>

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2142. By Thomas Moenicke

fixed an issue that showed text blue even if word engine is off

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2143. By Thomas Moenicke

fixed issue of not showing wordribbon after using the browser: LayoutUpdater created a new instance of WordRibbon on every setWordRibbonVisible
improved Model: not resetting model when appending a wordcandidate

2144. By Thomas Moenicke

merge: no change rebuild against maliit-framework in archive

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2145. By Thomas Moenicke

adding unittests for WordRibbon

2146. By Thomas Moenicke

adding unittest runner script
removed debug output from unittest

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2147. By Thomas Moenicke

enabled editor unittests

2148. By Thomas Moenicke

server.conf settings overwrite inputMethodHints
e.g. word_engine_enabled = false hides the wordribbon/engine no matter what the inputMethodFlag says

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested and working pretty well. going to approve but a few things need fixing. do that in another MR
1) the url layout never gets enabled
 +
722 + if (d->host->contentType(valid) == Maliit::UrlContentType)
723 + setActiveSubView("url");
724 +

I never see this code being executed and the layout changing with the .com key showing

2) It's nice in notepad with word prediction turned on it auto-capatilizes the first letter after typing a period. We should try and always auto-capatilize after the period even in word prediction turned off.

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

approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-25 15:41:34 +0000
+++ debian/changelog 2013-07-29 14:19:29 +0000
@@ -8,7 +8,7 @@
88
9 * fix reporting wrong keyboard rectangle9 * fix reporting wrong keyboard rectangle
1010
11 -- Thomas Moenicke <thomas@pachamama> Wed, 10 Jul 2013 14:10:11 +020011 -- Thomas Moenicke <thomas@pachamama> Fri, 05 Jul 2013 11:45:27 +0200
1212
13maliit-plugins (0.99.trunk.phablet0) saucy; urgency=low13maliit-plugins (0.99.trunk.phablet0) saucy; urgency=low
1414
1515
=== added file 'maliit-keyboard/data/languages/url.xml'
--- maliit-keyboard/data/languages/url.xml 1970-01-01 00:00:00 +0000
+++ maliit-keyboard/data/languages/url.xml 2013-07-29 14:19:29 +0000
@@ -0,0 +1,484 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE keyboard SYSTEM "VirtualKeyboardLayout.dtd">
3
4<keyboard catalog="en_us" language="en_us" title="English (US)" version="1.0">
5 <layout type="general">
6 <section id="main">
7 <row>
8 <key>
9 <binding label="q">
10 <modifiers keys="shift">
11 <binding label="Q" />
12 </modifiers>
13 </binding>
14 </key>
15 <key>
16 <binding label="w">
17 <modifiers keys="shift">
18 <binding label="W" />
19 </modifiers>
20 </binding>
21 </key>
22 <key>
23 <extended>
24 <row>
25 <key>
26 <binding label="è">
27 <modifiers keys="shift">
28 <binding label="È" />
29 </modifiers>
30 </binding>
31 </key>
32 <key>
33 <binding label="é">
34 <modifiers keys="shift">
35 <binding label="É" />
36 </modifiers>
37 </binding>
38 </key>
39 <key>
40 <binding label="ê">
41 <modifiers keys="shift">
42 <binding label="Ê" />
43 </modifiers>
44 </binding>
45 </key>
46 <key>
47 <binding label="ë">
48 <modifiers keys="shift">
49 <binding label="Ë" />
50 </modifiers>
51 </binding>
52 </key>
53 <key>
54 <binding label="€">
55 <modifiers keys="shift">
56 <binding label="€" />
57 </modifiers>
58 </binding>
59 </key>
60 </row>
61 </extended>
62 <binding label="e">
63 <modifiers keys="shift">
64 <binding label="E" />
65 </modifiers>
66 </binding>
67 </key>
68 <key>
69 <binding label="r">
70 <modifiers keys="shift">
71 <binding label="R" />
72 </modifiers>
73 </binding>
74 </key>
75 <key>
76 <extended>
77 <row>
78 <key>
79 <binding label="þ">
80 <modifiers keys="shift">
81 <binding label="Þ" />
82 </modifiers>
83 </binding>
84 </key>
85 </row>
86 </extended>
87 <binding label="t">
88 <modifiers keys="shift">
89 <binding label="T" />
90 </modifiers>
91 </binding>
92 </key>
93 <key>
94 <extended>
95 <row>
96 <key>
97 <binding label="ý">
98 <modifiers keys="shift">
99 <binding label="Ý" />
100 </modifiers>
101 </binding>
102 </key>
103 <key>
104 <binding label="¥">
105 <modifiers keys="shift">
106 <binding label="¥" />
107 </modifiers>
108 </binding>
109 </key>
110 </row>
111 </extended>
112 <binding label="y">
113 <modifiers keys="shift">
114 <binding label="Y" />
115 </modifiers>
116 </binding>
117 </key>
118 <key>
119 <extended>
120 <row>
121 <key>
122 <binding label="û">
123 <modifiers keys="shift">
124 <binding label="Û" />
125 </modifiers>
126 </binding>
127 </key>
128 <key>
129 <binding label="ù">
130 <modifiers keys="shift">
131 <binding label="Ù" />
132 </modifiers>
133 </binding>
134 </key>
135 <key>
136 <binding label="ú">
137 <modifiers keys="shift">
138 <binding label="Ú" />
139 </modifiers>
140 </binding>
141 </key>
142 <key>
143 <binding label="ü">
144 <modifiers keys="shift">
145 <binding label="Ü" />
146 </modifiers>
147 </binding>
148 </key>
149 </row>
150 </extended>
151 <binding label="u">
152 <modifiers keys="shift">
153 <binding label="U" />
154 </modifiers>
155 </binding>
156 </key>
157 <key>
158 <extended>
159 <row>
160 <key>
161 <binding label="î">
162 <modifiers keys="shift">
163 <binding label="Î" />
164 </modifiers>
165 </binding>
166 </key>
167 <key>
168 <binding label="ï">
169 <modifiers keys="shift">
170 <binding label="Ï" />
171 </modifiers>
172 </binding>
173 </key>
174 <key>
175 <binding label="ì">
176 <modifiers keys="shift">
177 <binding label="Ì" />
178 </modifiers>
179 </binding>
180 </key>
181 <key>
182 <binding label="í">
183 <modifiers keys="shift">
184 <binding label="Í" />
185 </modifiers>
186 </binding>
187 </key>
188 </row>
189 </extended>
190 <binding label="i">
191 <modifiers keys="shift">
192 <binding label="I" />
193 </modifiers>
194 </binding>
195 </key>
196 <key>
197 <extended>
198 <row>
199 <key>
200 <binding label="ö">
201 <modifiers keys="shift">
202 <binding label="Ö" />
203 </modifiers>
204 </binding>
205 </key>
206 <key>
207 <binding label="ô">
208 <modifiers keys="shift">
209 <binding label="Ô" />
210 </modifiers>
211 </binding>
212 </key>
213 <key>
214 <binding label="ò">
215 <modifiers keys="shift">
216 <binding label="Ò" />
217 </modifiers>
218 </binding>
219 </key>
220 <key>
221 <binding label="ó">
222 <modifiers keys="shift">
223 <binding label="Ó" />
224 </modifiers>
225 </binding>
226 </key>
227 </row>
228 </extended>
229 <binding label="o">
230 <modifiers keys="shift">
231 <binding label="O" />
232 </modifiers>
233 </binding>
234 </key>
235 <key>
236 <binding label="p">
237 <modifiers keys="shift">
238 <binding label="P" />
239 </modifiers>
240 </binding>
241 </key>
242 </row>
243 <row>
244 <spacer />
245 <key>
246 <extended>
247 <row>
248 <key>
249 <binding label="ä">
250 <modifiers keys="shift">
251 <binding label="Ä" />
252 </modifiers>
253 </binding>
254 </key>
255 <key>
256 <binding label="à">
257 <modifiers keys="shift">
258 <binding label="À" />
259 </modifiers>
260 </binding>
261 </key>
262 <key>
263 <binding label="â">
264 <modifiers keys="shift">
265 <binding label="Â" />
266 </modifiers>
267 </binding>
268 </key>
269 <key>
270 <binding label="á">
271 <modifiers keys="shift">
272 <binding label="Á" />
273 </modifiers>
274 </binding>
275 </key>
276 <key>
277 <binding label="ã">
278 <modifiers keys="shift">
279 <binding label="Ã" />
280 </modifiers>
281 </binding>
282 </key>
283 <key>
284 <binding label="å">
285 <modifiers keys="shift">
286 <binding label="Å" />
287 </modifiers>
288 </binding>
289 </key>
290 </row>
291 </extended>
292 <binding label="a">
293 <modifiers keys="shift">
294 <binding label="A" />
295 </modifiers>
296 </binding>
297 </key>
298 <key>
299 <extended>
300 <row>
301 <key>
302 <binding label="ß">
303 <modifiers keys="shift">
304 <binding label="$" />
305 </modifiers>
306 </binding>
307 </key>
308 <key>
309 <binding label="$" />
310 </key>
311 </row>
312 </extended>
313 <binding label="s">
314 <modifiers keys="shift">
315 <binding label="S" />
316 </modifiers>
317 </binding>
318 </key>
319 <key>
320 <extended>
321 <row>
322 <key>
323 <binding label="ð">
324 <modifiers keys="shift">
325 <binding label="Ð" />
326 </modifiers>
327 </binding>
328 </key>
329 </row>
330 </extended>
331 <binding label="d">
332 <modifiers keys="shift">
333 <binding label="D" />
334 </modifiers>
335 </binding>
336 </key>
337 <key>
338 <binding label="f">
339 <modifiers keys="shift">
340 <binding label="F" />
341 </modifiers>
342 </binding>
343 </key>
344 <key>
345 <binding label="g">
346 <modifiers keys="shift">
347 <binding label="G" />
348 </modifiers>
349 </binding>
350 </key>
351 <key>
352 <binding label="h">
353 <modifiers keys="shift">
354 <binding label="H" />
355 </modifiers>
356 </binding>
357 </key>
358 <key>
359 <binding label="j">
360 <modifiers keys="shift">
361 <binding label="J" />
362 </modifiers>
363 </binding>
364 </key>
365 <key>
366 <binding label="k">
367 <modifiers keys="shift">
368 <binding label="K" />
369 </modifiers>
370 </binding>
371 </key>
372 <key>
373 <binding label="l">
374 <modifiers keys="shift">
375 <binding label="L" />
376 </modifiers>
377 </binding>
378 </key>
379 <spacer />
380 </row>
381 <row>
382 <key style="special" width="large">
383 <binding action="shift" />
384 </key>
385 <spacer />
386 <key>
387 <binding label="z">
388 <modifiers keys="shift">
389 <binding label="Z" />
390 </modifiers>
391 </binding>
392 </key>
393 <key>
394 <binding label="x">
395 <modifiers keys="shift">
396 <binding label="X" />
397 </modifiers>
398 </binding>
399 </key>
400 <key>
401 <extended>
402 <row>
403 <key>
404 <binding label="ç">
405 <modifiers keys="shift">
406 <binding label="Ç" />
407 </modifiers>
408 </binding>
409 </key>
410 </row>
411 </extended>
412 <binding label="c">
413 <modifiers keys="shift">
414 <binding label="C" />
415 </modifiers>
416 </binding>
417 </key>
418 <key>
419 <binding label="v">
420 <modifiers keys="shift">
421 <binding label="V" />
422 </modifiers>
423 </binding>
424 </key>
425 <key>
426 <binding label="b">
427 <modifiers keys="shift">
428 <binding label="B" />
429 </modifiers>
430 </binding>
431 </key>
432 <key>
433 <extended>
434 <row>
435 <key>
436 <binding label="ñ">
437 <modifiers keys="shift">
438 <binding label="Ñ" />
439 </modifiers>
440 </binding>
441 </key>
442 </row>
443 </extended>
444 <binding label="n">
445 <modifiers keys="shift">
446 <binding label="N" />
447 </modifiers>
448 </binding>
449 </key>
450 <key>
451 <binding label="m">
452 <modifiers keys="shift">
453 <binding label="M" />
454 </modifiers>
455 </binding>
456 </key>
457 <spacer />
458 <key style="special" width="large">
459 <binding action="backspace" />
460 </key>
461 </row>
462 <row>
463 <key style="special" width="x-large">
464 <binding action="sym" label="?123" />
465 </key>
466 <spacer />
467 <key id="emailUrlKey">
468 <binding label=".com" />
469 </key>
470 <key width="xx-large">
471 <binding action="space" />
472 </key>
473 <key>
474 <binding label="." />
475 </key>
476 <spacer />
477 <key id="actionKey" style="special" width="x-large">
478 <binding action="return" />
479 </key>
480 </row>
481 </section>
482 </layout>
483 <import file="symbols_en.xml" />
484</keyboard>
0485
=== modified file 'maliit-keyboard/lib/logic/keyareaconverter.cpp'
--- maliit-keyboard/lib/logic/keyareaconverter.cpp 2013-06-05 13:00:26 +0000
+++ maliit-keyboard/lib/logic/keyareaconverter.cpp 2013-07-29 14:19:29 +0000
@@ -100,6 +100,7 @@
100 qreal consumed_width = 0;100 qreal consumed_width = 0;
101101
102 QVector<int> margins = uiConst->calculateMargins(orientation, kb);102 QVector<int> margins = uiConst->calculateMargins(orientation, kb);
103 Q_ASSERT(margins.size() > 0);
103 qreal margin = margins[0];104 qreal margin = margins[0];
104105
105 int row = 0;106 int row = 0;
106107
=== modified file 'maliit-keyboard/lib/logic/layoutupdater.cpp'
--- maliit-keyboard/lib/logic/layoutupdater.cpp 2013-06-14 09:55:01 +0000
+++ maliit-keyboard/lib/logic/layoutupdater.cpp 2013-07-29 14:19:29 +0000
@@ -34,7 +34,6 @@
34#include "style.h"34#include "style.h"
3535
36#include "models/area.h"36#include "models/area.h"
37#include "models/keyboard.h"
38#include "models/keydescription.h"37#include "models/keydescription.h"
39#include "models/wordribbon.h"38#include "models/wordribbon.h"
40#include "models/wordcandidate.h"39#include "models/wordcandidate.h"
@@ -333,6 +332,8 @@
333 d->layout->setCenterPanel(d->inShiftedState() ? converter.shiftedKeyArea()332 d->layout->setCenterPanel(d->inShiftedState() ? converter.shiftedKeyArea()
334 : converter.keyArea());333 : converter.keyArea());
335334
335 converter.keyArea();
336 d->layout->setCenterPanel(converter.keyArea());
336 if (isWordRibbonVisible())337 if (isWordRibbonVisible())
337 applyStyleToWordRibbon(d->layout->wordRibbon(), d->style, orientation);338 applyStyleToWordRibbon(d->layout->wordRibbon(), d->style, orientation);
338339
@@ -359,13 +360,7 @@
359 if (d->word_ribbon_visible != visible) {360 if (d->word_ribbon_visible != visible) {
360 d->word_ribbon_visible = visible;361 d->word_ribbon_visible = visible;
361362
362 if (d->layout && d->style && d->word_ribbon_visible) {363 d->layout->wordRibbon()->clearCandidates();
363 WordRibbon* ribbon = new WordRibbon;
364 applyStyleToWordRibbon(ribbon, d->style, d->layout->orientation());
365 d->layout->setWordRibbon(ribbon);
366 } else if (d->layout) {
367 d->layout->setWordRibbon(new WordRibbon);
368 }
369364
370 Q_EMIT wordRibbonVisibleChanged(visible);365 Q_EMIT wordRibbonVisibleChanged(visible);
371 }366 }
372367
=== modified file 'maliit-keyboard/lib/models/wordribbon.cpp'
--- maliit-keyboard/lib/models/wordribbon.cpp 2013-05-31 16:09:14 +0000
+++ maliit-keyboard/lib/models/wordribbon.cpp 2013-07-29 14:19:29 +0000
@@ -65,9 +65,9 @@
6565
66void WordRibbon::appendCandidate(const WordCandidate &candidate)66void WordRibbon::appendCandidate(const WordCandidate &candidate)
67{67{
68 beginResetModel();68 beginInsertRows(QModelIndex(), rowCount(), rowCount());
69 m_candidates.append(candidate);69 m_candidates.append(candidate);
70 endResetModel();70 endInsertRows(); // fires signal rowsInserted()
71}71}
7272
73QVector<WordCandidate> WordRibbon::candidates() const73QVector<WordCandidate> WordRibbon::candidates() const
7474
=== modified file 'maliit-keyboard/lib/models/wordribbon.h'
--- maliit-keyboard/lib/models/wordribbon.h 2013-05-31 16:09:14 +0000
+++ maliit-keyboard/lib/models/wordribbon.h 2013-07-29 14:19:29 +0000
@@ -61,7 +61,7 @@
61 };61 };
6262
63 virtual QVariant data(const QModelIndex &index, int role) const;63 virtual QVariant data(const QModelIndex &index, int role) const;
64 virtual int rowCount(const QModelIndex &parent) const;64 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
65 virtual QHash<int, QByteArray> roleNames() const;65 virtual QHash<int, QByteArray> roleNames() const;
6666
67 bool valid() const;67 bool valid() const;
6868
=== modified file 'maliit-keyboard/maliit-keyboard.pro'
--- maliit-keyboard/maliit-keyboard.pro 2013-03-22 16:40:29 +0000
+++ maliit-keyboard/maliit-keyboard.pro 2013-07-29 14:19:29 +0000
@@ -6,6 +6,7 @@
6 plugin \6 plugin \
7 data \7 data \
8 qml \8 qml \
9 tests \
9 benchmark \10 benchmark \
1011
1112
1213
=== modified file 'maliit-keyboard/plugin/inputmethod.cpp'
--- maliit-keyboard/plugin/inputmethod.cpp 2013-07-10 14:26:09 +0000
+++ maliit-keyboard/plugin/inputmethod.cpp 2013-07-29 14:19:29 +0000
@@ -110,7 +110,6 @@
110 ScopedSetting auto_correct;110 ScopedSetting auto_correct;
111 ScopedSetting auto_caps;111 ScopedSetting auto_caps;
112 ScopedSetting word_engine;112 ScopedSetting word_engine;
113 ScopedSetting hide_word_ribbon_in_portrait_mode;
114};113};
115114
116class LayoutGroup115class LayoutGroup
@@ -148,6 +147,7 @@
148class InputMethodPrivate147class InputMethodPrivate
149{148{
150public:149public:
150 InputMethod* q;
151 QQuickItem* qmlRootItem;151 QQuickItem* qmlRootItem;
152#ifdef EXTENDED_SURFACE_TEMP_DISABLED152#ifdef EXTENDED_SURFACE_TEMP_DISABLED
153 SharedSurface extended_surface;153 SharedSurface extended_surface;
@@ -174,22 +174,23 @@
174 MAbstractInputMethodHost *host);174 MAbstractInputMethodHost *host);
175 void setLayoutOrientation(Logic::LayoutHelper::Orientation orientation);175 void setLayoutOrientation(Logic::LayoutHelper::Orientation orientation);
176 void updateKeyboardOrientation();176 void updateKeyboardOrientation();
177 void syncWordEngine(Logic::LayoutHelper::Orientation orientation);177 void updateWordRibbon();
178178
179 void connectToNotifier();179 void connectToNotifier();
180 void setContextProperties(QQmlContext *qml_context);180 void setContextProperties(QQmlContext *qml_context);
181};181};
182182
183183
184InputMethodPrivate::InputMethodPrivate(InputMethod *const q,184InputMethodPrivate::InputMethodPrivate(InputMethod *const _q,
185 MAbstractInputMethodHost *host)185 MAbstractInputMethodHost *host)
186 // : surface_factory(host->surfaceFactory())186 // : surface_factory(host->surfaceFactory())
187 // , surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_surface_options)))187 // , surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_surface_options)))
188 : q(_q)
188#ifdef EXTENDED_SURFACE_TEMP_DISABLED189#ifdef EXTENDED_SURFACE_TEMP_DISABLED
189 , extended_surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_extended_surface_options, surface)))190 , extended_surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_extended_surface_options, surface)))
190 , magnifier_surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_extended_surface_options, surface)))191 , magnifier_surface(qSharedPointerDynamicCast<Surface>(surface_factory->create(g_extended_surface_options, surface)))
191#endif192#endif
192 : editor(EditorOptions(), new Model::Text, new Logic::WordEngine, new Logic::LanguageFeatures)193 , editor(EditorOptions(), new Model::Text, new Logic::WordEngine, new Logic::LanguageFeatures)
193 , feedback()194 , feedback()
194 , style(new Style)195 , style(new Style)
195 , notifier()196 , notifier()
@@ -238,9 +239,6 @@
238 QObject::connect(&layout.updater, SIGNAL(languageChanged(QString)),239 QObject::connect(&layout.updater, SIGNAL(languageChanged(QString)),
239 &editor, SLOT(onLanguageChanged(const QString&)));240 &editor, SLOT(onLanguageChanged(const QString&)));
240241
241 // just for now
242 layout.updater.setWordRibbonVisible(true);
243
244#ifdef EXTENDED_SURFACE_TEMP_DISABLED242#ifdef EXTENDED_SURFACE_TEMP_DISABLED
245 QObject::connect(&layout.event_handler, SIGNAL(extendedKeysShown(Key)),243 QObject::connect(&layout.event_handler, SIGNAL(extendedKeysShown(Key)),
246 &extended_layout.event_handler, SLOT(onExtendedKeysShown(Key)));244 &extended_layout.event_handler, SLOT(onExtendedKeysShown(Key)));
@@ -303,9 +301,17 @@
303 view->setResizeMode(QQuickView::SizeRootObjectToView);301 view->setResizeMode(QQuickView::SizeRootObjectToView);
304}302}
305303
304void InputMethodPrivate::updateWordRibbon()
305{
306 layout.helper.wordRibbon()->setEnabled( predictionEnabled );
307 Q_EMIT q->wordRibbonEnabledChanged( predictionEnabled );
308 qmlRootItem->setProperty("wordribbon_visible", predictionEnabled );
309
310 updateKeyboardOrientation();
311}
312
306void InputMethodPrivate::setLayoutOrientation(Logic::LayoutHelper::Orientation orientation)313void InputMethodPrivate::setLayoutOrientation(Logic::LayoutHelper::Orientation orientation)
307{314{
308 syncWordEngine(orientation);
309 layout.updater.setOrientation(orientation);315 layout.updater.setOrientation(orientation);
310 extended_layout.updater.setOrientation(orientation);316 extended_layout.updater.setOrientation(orientation);
311317
@@ -363,23 +369,6 @@
363 setLayoutOrientation(uiConst->screenToMaliitOrientation(QGuiApplication::primaryScreen()->orientation()));369 setLayoutOrientation(uiConst->screenToMaliitOrientation(QGuiApplication::primaryScreen()->orientation()));
364}370}
365371
366void InputMethodPrivate::syncWordEngine(Logic::LayoutHelper::Orientation orientation)
367{
368 // hide_word_ribbon_in_potrait_mode_setting overrides word_engine_setting:
369#ifndef DISABLE_PREEDIT
370 const bool override_activation(settings.hide_word_ribbon_in_portrait_mode->value().toBool()
371 && orientation == Logic::LayoutHelper::Portrait);
372#else
373 Q_UNUSED(orientation)
374 const bool override_activation = true;
375#endif
376
377
378 editor.wordEngine()->setEnabled(override_activation
379 ? false
380 : settings.word_engine->value().toBool());
381}
382
383void InputMethodPrivate::connectToNotifier()372void InputMethodPrivate::connectToNotifier()
384{373{
385#ifdef TEMP_DISABLED374#ifdef TEMP_DISABLED
@@ -452,7 +441,7 @@
452 connect(&d->editor, SIGNAL(rightLayoutSelected()),441 connect(&d->editor, SIGNAL(rightLayoutSelected()),
453 this, SLOT(onRightLayoutSelected()));442 this, SLOT(onRightLayoutSelected()));
454443
455 connect(this, SIGNAL(wordEngineEnabledChanged(bool)), uiConst, SLOT(onWordEngineSettingsChanged(bool)));444 connect(this, SIGNAL(wordRibbonEnabledChanged(bool)), uiConst, SLOT(onWordEngineSettingsChanged(bool)));
456445
457 connect(this, SIGNAL(predictionEnabledChanged()), this, SLOT(updateWordEngine()));446 connect(this, SIGNAL(predictionEnabledChanged()), this, SLOT(updateWordEngine()));
458447
@@ -462,13 +451,11 @@
462 registerAutoCorrectSetting(host);451 registerAutoCorrectSetting(host);
463 registerAutoCapsSetting(host);452 registerAutoCapsSetting(host);
464 registerWordEngineSetting(host);453 registerWordEngineSetting(host);
465 registerHideWordRibbonInPortraitModeSetting(host);
466454
467 setActiveSubView("en_us");455 setActiveSubView("en_us");
468456
469 // Setting layout orientation depends on word engine and hide word ribbon457 // Setting layout orientation depends on word engine and hide word ribbon
470 // settings to be initialized first:458 // settings to be initialized first:
471
472 d->updateKeyboardOrientation();459 d->updateKeyboardOrientation();
473}460}
474461
@@ -478,8 +465,13 @@
478void InputMethod::show()465void InputMethod::show()
479{466{
480 Q_D(InputMethod);467 Q_D(InputMethod);
468 bool valid = true;
481469
482 d->view->setVisible(true);470 d->view->setVisible(true);
471
472 if (d->host->contentType(valid) == Maliit::UrlContentType)
473 setActiveSubView("url");
474
483#ifdef EXTENDED_SURFACE_TEMP_DISABLED475#ifdef EXTENDED_SURFACE_TEMP_DISABLED
484 d->surface->show();476 d->surface->show();
485 d->extended_surface->show();477 d->extended_surface->show();
@@ -706,35 +698,17 @@
706 attributes));698 attributes));
707699
708 connect(d->settings.word_engine.data(), SIGNAL(valueChanged()),700 connect(d->settings.word_engine.data(), SIGNAL(valueChanged()),
709 this, SLOT(onWordEngineSettingChanged()));701 this, SLOT(updateWordEngine()));
710702
711 Q_EMIT wordEngineEnabledChanged( d->settings.word_engine.data()->value().toBool() );703 Q_EMIT wordEngineEnabledChanged( d->settings.word_engine.data()->value().toBool() );
712704
713#ifndef DISABLE_PREEDIT705#ifndef DISABLE_PREEDIT
714 d->layout.helper.wordRibbon()->setEnabled(d->settings.word_engine->value().toBool());
715 d->editor.wordEngine()->setEnabled(d->settings.word_engine->value().toBool());706 d->editor.wordEngine()->setEnabled(d->settings.word_engine->value().toBool());
716#else707#else
717 d->editor.wordEngine()->setEnabled(false);708 d->editor.wordEngine()->setEnabled(false);
718#endif709#endif
719}710}
720711
721void InputMethod::registerHideWordRibbonInPortraitModeSetting(MAbstractInputMethodHost *host)
722{
723 Q_D(InputMethod);
724
725 QVariantMap attributes;
726 attributes[Maliit::SettingEntryAttributes::defaultValue] = false;
727
728 d->settings.hide_word_ribbon_in_portrait_mode.reset(
729 host->registerPluginSetting("hide_word_ribbon_in_potrait_mode",
730 QT_TR_NOOP("Disable word engine in portrait mode"),
731 Maliit::BoolType,
732 attributes));
733
734 connect(d->settings.hide_word_ribbon_in_portrait_mode.data(), SIGNAL(valueChanged()),
735 this, SLOT(onHideWordRibbonInPortraitModeSettingChanged()));
736}
737
738void InputMethod::onLeftLayoutSelected()712void InputMethod::onLeftLayoutSelected()
739{713{
740 // This API smells real bad.714 // This API smells real bad.
@@ -794,21 +768,6 @@
794 d->editor.setAutoCapsEnabled(d->settings.auto_caps->value().toBool());768 d->editor.setAutoCapsEnabled(d->settings.auto_caps->value().toBool());
795}769}
796770
797void InputMethod::onWordEngineSettingChanged()
798{
799 // FIXME: Renderer doesn't seem to update graphics properly. Word ribbon
800 // is still visible until next VKB show/hide.
801 Q_D(InputMethod);
802 Q_EMIT wordEngineEnabledChanged( d->settings.word_engine.data()->value().toBool() );
803 d->syncWordEngine(d->layout.helper.orientation());
804}
805
806void InputMethod::onHideWordRibbonInPortraitModeSettingChanged()
807{
808 Q_D(InputMethod);
809 d->setLayoutOrientation(d->layout.helper.orientation());
810}
811
812void InputMethod::setKeyOverrides(const QMap<QString, QSharedPointer<MKeyOverride> > &overrides)771void InputMethod::setKeyOverrides(const QMap<QString, QSharedPointer<MKeyOverride> > &overrides)
813{772{
814 Q_D(InputMethod);773 Q_D(InputMethod);
@@ -941,18 +900,25 @@
941 if (!valid)900 if (!valid)
942 newPredictionEnabled = true;901 newPredictionEnabled = true;
943902
944 if (newPredictionEnabled != d->predictionEnabled) {903 if (d->predictionEnabled != newPredictionEnabled) {
945 d->predictionEnabled = newPredictionEnabled;904 d->predictionEnabled = newPredictionEnabled;
946 emitPredictionEnabled = true;905 emitPredictionEnabled = true;
947 }906 }
948
949 if (emitPredictionEnabled)907 if (emitPredictionEnabled)
950 Q_EMIT predictionEnabledChanged();908 Q_EMIT predictionEnabledChanged();
909
951}910}
952911
953void InputMethod::updateWordEngine()912void InputMethod::updateWordEngine()
954{913{
955 // FIXME stub914 Q_D(InputMethod);
915
916 if (!d->settings.word_engine.data()->value().toBool())
917 d->predictionEnabled = false;
918
919 d->editor.clearPreedit();
920 d->editor.wordEngine()->setEnabled( d->predictionEnabled );
921 d->updateWordRibbon();
956}922}
957923
958bool InputMethod::predictionEnabled()924bool InputMethod::predictionEnabled()
959925
=== modified file 'maliit-keyboard/plugin/inputmethod.h'
--- maliit-keyboard/plugin/inputmethod.h 2013-07-04 08:33:23 +0000
+++ maliit-keyboard/plugin/inputmethod.h 2013-07-29 14:19:29 +0000
@@ -97,8 +97,6 @@
97 Q_SLOT void onFeedbackSettingChanged();97 Q_SLOT void onFeedbackSettingChanged();
98 Q_SLOT void onAutoCorrectSettingChanged();98 Q_SLOT void onAutoCorrectSettingChanged();
99 Q_SLOT void onAutoCapsSettingChanged();99 Q_SLOT void onAutoCapsSettingChanged();
100 Q_SLOT void onWordEngineSettingChanged();
101 Q_SLOT void onHideWordRibbonInPortraitModeSettingChanged();
102 Q_SLOT void updateKey(const QString &key_id,100 Q_SLOT void updateKey(const QString &key_id,
103 const MKeyOverride::KeyOverrideAttributes changed_attributes);101 const MKeyOverride::KeyOverrideAttributes changed_attributes);
104 Q_SLOT void onKeyboardClosed();102 Q_SLOT void onKeyboardClosed();
@@ -116,6 +114,7 @@
116114
117 Q_SLOT void onHideAnimationFinished();115 Q_SLOT void onHideAnimationFinished();
118 Q_SIGNAL void wordEngineEnabledChanged(bool wordEngineEnabled);116 Q_SIGNAL void wordEngineEnabledChanged(bool wordEngineEnabled);
117 Q_SIGNAL void wordRibbonEnabledChanged(bool wordRibbonEnabled);
119118
120 const QScopedPointer<InputMethodPrivate> d_ptr;119 const QScopedPointer<InputMethodPrivate> d_ptr;
121};120};
122121
=== modified file 'maliit-keyboard/qml/Keyboard.qml'
--- maliit-keyboard/qml/Keyboard.qml 2013-07-04 08:32:31 +0000
+++ maliit-keyboard/qml/Keyboard.qml 2013-07-29 14:19:29 +0000
@@ -41,6 +41,8 @@
41 visible: layout.visible41 visible: layout.visible
4242
43 property bool shown: false;43 property bool shown: false;
44 property bool wordribbon_visible: true;
45
44 property bool hideAnimationFinished: false;46 property bool hideAnimationFinished: false;
45 property int pressedKeyIndex: -1;47 property int pressedKeyIndex: -1;
46 property Item pressedKey;48 property Item pressedKey;
@@ -77,16 +79,17 @@
77 anchors.bottom: keypadMouseArea.top79 anchors.bottom: keypadMouseArea.top
78 width: parent.width;80 width: parent.width;
7981
80 height: maliit_wordribbon.enabled ? layout.wordribbon_height : 082 height: wordribbon_visible ? layout.wordribbon_height : 0
81 }83 }
8284
83 MouseArea {85 MouseArea {
84 id: keypadMouseArea86 id: keypadMouseArea
85 preventStealing: true87 preventStealing: true
88
86 anchors {89 anchors {
87 top: wordRibbon.bottom90 top: wordRibbon.bottom
88 fill: parent91 fill: parent
89 topMargin: layout.invisible_toucharea_height + (maliit_wordribbon.enabled ? layout.wordribbon_height : 0);92 topMargin: layout.invisible_toucharea_height + (wordribbon_visible ? layout.wordribbon_height : 0);
90 }93 }
9194
92 Item {95 Item {
9396
=== modified file 'maliit-keyboard/tests/common/inputmethodhostprobe.cpp'
--- maliit-keyboard/tests/common/inputmethodhostprobe.cpp 2012-11-21 15:19:50 +0000
+++ maliit-keyboard/tests/common/inputmethodhostprobe.cpp 2013-07-29 14:19:29 +0000
@@ -121,3 +121,18 @@
121{121{
122 return m_last_preedit_text_format_list;122 return m_last_preedit_text_format_list;
123}123}
124
125void InputMethodHostProbe::registerWindow(QWindow*, Maliit::Position)
126{
127
128}
129
130void InputMethodHostProbe::setScreenRegion(const QRegion&, QWindow*)
131{
132
133}
134
135void InputMethodHostProbe::setInputMethodArea(const QRegion&, QWindow*)
136{
137
138}
124139
=== modified file 'maliit-keyboard/tests/common/inputmethodhostprobe.h'
--- maliit-keyboard/tests/common/inputmethodhostprobe.h 2012-11-21 15:19:50 +0000
+++ maliit-keyboard/tests/common/inputmethodhostprobe.h 2013-07-29 14:19:29 +0000
@@ -96,7 +96,6 @@
96 void setRedirectKeys(bool) {}96 void setRedirectKeys(bool) {}
97 void setDetectableAutoRepeat(bool) {}97 void setDetectableAutoRepeat(bool) {}
98 void setGlobalCorrectionEnabled(bool) {}98 void setGlobalCorrectionEnabled(bool) {}
99 void setInputModeIndicator(Maliit::InputModeIndicator) {}
100 void switchPlugin(Maliit::SwitchDirection) {}99 void switchPlugin(Maliit::SwitchDirection) {}
101 void switchPlugin(const QString&) {}100 void switchPlugin(const QString&) {}
102 void setScreenRegion(const QRegion&) {}101 void setScreenRegion(const QRegion&) {}
@@ -104,13 +103,17 @@
104 void setSelection(int, int) {}103 void setSelection(int, int) {}
105 void setOrientationAngleLocked(bool) {}104 void setOrientationAngleLocked(bool) {}
106 QList<MImPluginDescription> pluginDescriptions(Maliit::HandlerState) const {return QList<MImPluginDescription>();}105 QList<MImPluginDescription> pluginDescriptions(Maliit::HandlerState) const {return QList<MImPluginDescription>();}
107 Maliit::Plugins::AbstractSurfaceFactory* surfaceFactory() { return 0; }
108 Maliit::Plugins::AbstractPluginSetting* registerPluginSetting(const QString &,106 Maliit::Plugins::AbstractPluginSetting* registerPluginSetting(const QString &,
109 const QString &,107 const QString &,
110 Maliit::SettingEntryType ,108 Maliit::SettingEntryType ,
111 const QVariantMap &) { return 0; }109 const QVariantMap &) { return 0; }
112 void invokeAction(const QString &,110 void invokeAction(const QString &,
113 const QKeySequence &) {}111 const QKeySequence &) {}
112
113 virtual void registerWindow(QWindow*, Maliit::Position);
114 virtual void setScreenRegion(const QRegion&, QWindow*);
115 virtual void setInputMethodArea(const QRegion&, QWindow*);
116
114};117};
115118
116#endif // INPUTMETHODHOSTPROBE_H119#endif // INPUTMETHODHOSTPROBE_H
117120
=== modified file 'maliit-keyboard/tests/editor/editor.pro'
--- maliit-keyboard/tests/editor/editor.pro 2012-07-25 06:52:40 +0000
+++ maliit-keyboard/tests/editor/editor.pro 2013-07-29 14:19:29 +0000
@@ -2,14 +2,15 @@
2include(../common-check.pri)2include(../common-check.pri)
3include(../../config-plugin.pri)3include(../../config-plugin.pri)
44
5TOP_BUILDDIR = $${OUT_PWD}/../../..5TARGET = ut_editor
6TARGET = editor
7TEMPLATE = app6TEMPLATE = app
8QT = core testlib gui7QT = core testlib gui
98
10INCLUDEPATH += ../ ../../lib ../../9INCLUDEPATH += ../ ../../lib ../../
11LIBS += $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_PLUGIN_LIB} $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_VIEW_LIB} $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_LIB}10
12PRE_TARGETDEPS += $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_PLUGIN_LIB} $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_VIEW_LIB} $${TOP_BUILDDIR}/$${MALIIT_KEYBOARD_LIB}11TOP_BUILDDIR = $${OUT_PWD}/../..
12LIBS += -L$${TOP_BUILDDIR}/plugin -lmaliit-keyboard-plugin
13
1314
14HEADERS += \15HEADERS += \
15 wordengineprobe.h \16 wordengineprobe.h \
1617
=== modified file 'maliit-keyboard/tests/tests.pro'
--- maliit-keyboard/tests/tests.pro 2013-04-18 13:33:13 +0000
+++ maliit-keyboard/tests/tests.pro 2013-07-29 14:19:29 +0000
@@ -3,11 +3,12 @@
3 common \3 common \
4 editor \4 editor \
5 language-layout-switching \5 language-layout-switching \
6 preedit-string \6# preedit-string \
7 repeat-backspace \7 repeat-backspace \
8 word-candidates \8 word-candidates \
9 language-layout-loading \9 language-layout-loading \
10 qml-test-app \10 qml-test-app \
11 wordengine \
1112
12CONFIG += ordered13CONFIG += ordered
13QMAKE_EXTRA_TARGETS += check14QMAKE_EXTRA_TARGETS += check
1415
=== added directory 'maliit-keyboard/tests/wordengine'
=== added file 'maliit-keyboard/tests/wordengine/.bzrignore'
--- maliit-keyboard/tests/wordengine/.bzrignore 1970-01-01 00:00:00 +0000
+++ maliit-keyboard/tests/wordengine/.bzrignore 2013-07-29 14:19:29 +0000
@@ -0,0 +1,4 @@
1ut_wordengine
2Makefile
3*.moc
4*.o
05
=== added file 'maliit-keyboard/tests/wordengine/main.cpp'
--- maliit-keyboard/tests/wordengine/main.cpp 1970-01-01 00:00:00 +0000
+++ maliit-keyboard/tests/wordengine/main.cpp 2013-07-29 14:19:29 +0000
@@ -0,0 +1,114 @@
1
2
3#include "models/wordribbon.h"
4#include "plugin/inputmethod.h"
5#include "common/inputmethodhostprobe.h"
6
7#include <maliit/plugins/abstractinputmethodhost.h>
8
9#include <QtTest/QtTest>
10
11using namespace MaliitKeyboard;
12
13
14class TestWordEngine: public QObject
15{
16 Q_OBJECT
17private:
18
19 Q_SLOT void wordRibbon() {
20
21 // WordRibbon is a QAbstractListModel, exposed to QML
22
23 WordRibbon wr;
24
25 QCOMPARE(wr.candidates().size(), 0);
26
27
28 QHash<int, QByteArray> roles;
29 roles.insert(WordRibbon::WordRole, "word");
30 QCOMPARE( wr.roleNames(), roles );
31
32
33 WordCandidate wc1(WordCandidate::SourceUnknown, "word_1");
34 WordCandidate wc2(WordCandidate::SourceUnknown, "word_2");
35 WordCandidate wc3(WordCandidate::SourceUnknown, "word_3");
36
37 wr.appendCandidate(wc1);
38 wr.appendCandidate(wc2);
39 wr.appendCandidate(wc3);
40
41 QCOMPARE( wr.data( wr.index(0,0), WordRibbon::WordRole ), QVariant("word_1"));
42 QCOMPARE( wr.data( wr.index(1,0), WordRibbon::WordRole ), QVariant("word_2"));
43 QCOMPARE( wr.data( wr.index(2,0), WordRibbon::WordRole ), QVariant("word_3"));
44
45 QCOMPARE( wr.rowCount(), 3 );
46
47
48 QVector<WordCandidate> candidates = wr.candidates();
49 QCOMPARE( candidates.size(), 3 );
50 QCOMPARE( candidates[0], wc1 );
51 QCOMPARE( candidates[1], wc2 );
52 QCOMPARE( candidates[2], wc3 );
53
54 wr.clearCandidates();
55 QCOMPARE( wr.rowCount(), 0 );
56
57 wr.appendCandidate(wc1);
58 wr.appendCandidate(wc2);
59 wr.appendCandidate(wc3);
60
61 QCOMPARE( wr.rowCount(), 3 );
62
63 // initially set to false
64 QCOMPARE( wr.enabled(), false );
65
66 wr.setEnabled(true);
67 QCOMPARE( wr.enabled(), true );
68
69 wr.setEnabled(false);
70 QCOMPARE( wr.enabled(), false );
71
72 // later
73 QCOMPARE( wr.valid(), false );
74
75 WordCandidate w4(WordCandidate::SourceUnknown, "another_word");
76
77 // make sure model-related signals work
78 QSignalSpy modelAboutToBeResetSpy(&wr, SIGNAL( modelAboutToBeReset() ));
79 QSignalSpy rowsInsertedSpy(&wr, SIGNAL( rowsInserted(QModelIndex, int, int) ) );
80
81 QVERIFY(modelAboutToBeResetSpy.isValid());
82 QVERIFY(rowsInsertedSpy.isValid());
83
84 wr.appendCandidate(w4);
85
86 QCOMPARE(rowsInsertedSpy.count(), 1);
87
88 wr.clearCandidates();
89
90 QCOMPARE( modelAboutToBeResetSpy.count(), 1 );
91
92 QList<QVariant> arguments = rowsInsertedSpy.takeFirst();
93 QVERIFY(arguments[1].toInt() == 3);
94 QVERIFY(arguments[2].toInt() == 3);
95
96 /*
97 this API should be reviewed and refactored where appropriate:
98
99 valid
100 rect
101 origin/setOrigin - currently not used
102 rCandidates - returns reference, not copy. no const. not documented
103 area/rArea/setArea - currently not used
104 Q_PROPERTY enabled - currently not used
105 operator==
106 operator!=
107 */
108 }
109
110};
111
112
113QTEST_MAIN(TestWordEngine)
114#include "main.moc"
0115
=== added file 'maliit-keyboard/tests/wordengine/wordengine.pro'
--- maliit-keyboard/tests/wordengine/wordengine.pro 1970-01-01 00:00:00 +0000
+++ maliit-keyboard/tests/wordengine/wordengine.pro 2013-07-29 14:19:29 +0000
@@ -0,0 +1,16 @@
1include(../../config.pri)
2include(../common-check.pri)
3include(../../config-plugin.pri)
4
5CONFIG += testlib
6TEMPLATE = app
7TARGET = ut_wordengine
8INCLUDEPATH += . ../ ../../lib ../../
9QT = core testlib gui
10
11
12TOP_BUILDDIR = $${OUT_PWD}/../..
13LIBS += -L$${TOP_BUILDDIR}/plugin -lmaliit-keyboard-plugin
14
15
16SOURCES += main.cpp
017
=== added file 'unittests.sh'
--- unittests.sh 1970-01-01 00:00:00 +0000
+++ unittests.sh 2013-07-29 14:19:29 +0000
@@ -0,0 +1,11 @@
1
2
3adb push maliit-keyboard/plugin/libmaliit-keyboard-plugin.so /data/ubuntu/usr/lib/maliit/plugins/libmaliit-keyboard-plugin.so
4adb push maliit-keyboard/tests/wordengine/ut_wordengine /data/ubuntu/usr/bin
5adb push maliit-keyboard/tests/editor/ut_editor /data/ubuntu/usr/bin
6
7adb shell QT_QPA_PLATFORM=minimal LD_LIBRARY_PATH=/usr/lib/maliit/plugins:$_LD_LIBRARY_PATH /usr/bin/ut_editor
8adb shell QT_QPA_PLATFORM=minimal LD_LIBRARY_PATH=/usr/lib/maliit/plugins:$_LD_LIBRARY_PATH /usr/bin/ut_wordengine
9
10
11

Subscribers

People subscribed via source and target branches