Merge lp:~dandrader/ubuntu-keyboard/fixAngleToOrientationMap into lp:ubuntu-keyboard

Proposed by Daniel d'Andrada
Status: Merged
Merged at revision: 133
Proposed branch: lp:~dandrader/ubuntu-keyboard/fixAngleToOrientationMap
Merge into: lp:ubuntu-keyboard
Diff against target: 55 lines (+27/-12)
1 file modified
src/plugin/inputmethod.cpp (+27/-12)
To merge this branch: bzr merge lp:~dandrader/ubuntu-keyboard/fixAngleToOrientationMap
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+204293@code.launchpad.net

Commit message

Fixes mapping between rotation angles and screen orientations

Code was assuming that primary screen orientation was always landscape.

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
Bill Filler (bfiller) wrote :
Revision history for this message
Bill Filler (bfiller) wrote :

tested with https://code.launchpad.net/~dandrader/ubuntu/trusty/maliit-framework/orientationAngleMapping/+merge/204304 and worked as expected on tablet and N4

Did you perform an exploratory manual test run of the 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/<package-name>) on device or emulator?
YES

Did CI run pass? If not, please explain why.
YES

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
YES

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

Are there any related MPs required for this MP to build/function as expected?
Yes, https://code.launchpad.net/~dandrader/ubuntu/trusty/maliit-framework/orientationAngleMapping/+merge/204304

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

for the ci train, just create them in the same silo.

On Fri, Jan 31, 2014 at 8:18 PM, Bill Filler <email address hidden> wrote:
> NOTE depends on: https://code.launchpad.net/~dandrader/ubuntu/trusty/maliit-framework/orientationAngleMapping/+merge/204304
> --
> https://code.launchpad.net/~dandrader/ubuntu-keyboard/fixAngleToOrientationMap/+merge/204293
> Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~dandrader/ubuntu-keyboard/fixAngleToOrientationMap into lp:ubuntu-keyboard.

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 2014-01-23 16:42:33 +0000
3+++ src/plugin/inputmethod.cpp 2014-01-31 17:30:18 +0000
4@@ -57,6 +57,32 @@
5
6 namespace {
7
8+Qt::ScreenOrientation rotationAngleToScreenOrientation(int angle)
9+{
10+ bool portraitIsPrimary = QGuiApplication::primaryScreen()->primaryOrientation()
11+ == Qt::PortraitOrientation;
12+
13+ switch (angle) {
14+ case 0:
15+ return portraitIsPrimary ? Qt::PortraitOrientation
16+ : Qt::LandscapeOrientation;
17+ break;
18+ case 90:
19+ return portraitIsPrimary ? Qt::InvertedLandscapeOrientation
20+ : Qt::PortraitOrientation;
21+ break;
22+ case 180:
23+ return portraitIsPrimary ? Qt::InvertedPortraitOrientation
24+ : Qt::InvertedLandscapeOrientation;
25+ break;
26+ case 270:
27+ default:
28+ return portraitIsPrimary ? Qt::LandscapeOrientation
29+ : Qt::InvertedPortraitOrientation;
30+ break;
31+ }
32+}
33+
34 const QString g_maliit_keyboard_qml(UBUNTU_KEYBOARD_DATA_DIR "/Keyboard.qml");
35
36 Key overrideToKey(const SharedOverride &override)
37@@ -173,18 +199,7 @@
38 {
39 Q_D(InputMethod);
40
41- switch (angle) {
42- case 0:
43- d->appsCurrentOrientation = Qt::LandscapeOrientation; break;
44- case 90:
45- d->appsCurrentOrientation = Qt::InvertedPortraitOrientation; break;
46- case 180:
47- d->appsCurrentOrientation = Qt::InvertedLandscapeOrientation; break;
48- case 270:
49- default:
50- d->appsCurrentOrientation = Qt::PortraitOrientation; break;
51- }
52-
53+ d->appsCurrentOrientation = rotationAngleToScreenOrientation(angle);
54 d->setLayoutOrientation(d->appsCurrentOrientation);
55 }
56

Subscribers

People subscribed via source and target branches