Merge lp:~aacid/unity8/workaround_qt47709 into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1903
Merged at revision: 1908
Proposed branch: lp:~aacid/unity8/workaround_qt47709
Merge into: lp:unity8
Diff against target: 26 lines (+5/-0)
2 files modified
qml/Components/UnityInputInfo/UnityInputInfo.qml (+2/-0)
qml/OrientedShell.qml (+3/-0)
To merge this branch: bzr merge lp:~aacid/unity8/workaround_qt47709
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+267647@code.launchpad.net

Commit message

Workaround for bug 1473471

After three days of debugging I've been able to figure out why it is crashing, why it's random and i can provide a quick workaround in unity8 code.

## Why is it crashing? ##

The problem exists because we use the QML cache and because Qt has this bug https://bugreports.qt.io/browse/QTBUG-47709

The bug in Qt means that if for types with extended properties (Image and "source" in our case coming from the SDK) an Item is created before the type is extended, all subsquent items of the same type won't see the extended property either.

Since we're using the QML cache this means that the code loaded from the cache expects the extended property to be there, so when it access such property, it will crash.

## Why is it random? ##

It's random because the QML file loading is not always done in the *exact* same order, and thus in some cases the first Image is created in a file that imports Ubuntu.Components and in some cases the first image is created in a file that does not.

## How to workaround it? ##

A quick workaround is making sure Ubuntu.Components is imported in the first file that is imported, in unity8's case UnityInputInfo.qml that is a singleton imported from the root file (OrientedShell.qml)

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Explanation makes sense, happy to approve

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
give it time
 * Did you make sure that the branch does not contain spurious tags?
Y

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/UnityInputInfo/UnityInputInfo.qml'
2--- qml/Components/UnityInputInfo/UnityInputInfo.qml 2015-06-30 11:43:14 +0000
3+++ qml/Components/UnityInputInfo/UnityInputInfo.qml 2015-08-11 11:37:24 +0000
4@@ -18,6 +18,8 @@
5
6 import QtQuick 2.3
7 import Unity.InputInfo 0.1
8+// Workaround https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1473471
9+import Ubuntu.Components 1.2
10
11 Item {
12 id: root
13
14=== modified file 'qml/OrientedShell.qml'
15--- qml/OrientedShell.qml 2015-07-06 12:52:08 +0000
16+++ qml/OrientedShell.qml 2015-08-11 11:37:24 +0000
17@@ -21,6 +21,9 @@
18 import "Components"
19 import "Components/UnityInputInfo"
20 import "Rotation"
21+// Backup Workaround https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1473471
22+// in case we remove the UnityInputInfo import
23+import Ubuntu.Components 1.2
24
25 Rectangle {
26 id: root

Subscribers

People subscribed via source and target branches