Merge lp:~gcollura/ubuntu-ui-toolkit/staging-fix-1341814-and-1400297 into lp:ubuntu-ui-toolkit/staging

Proposed by Giulio Collura on 2015-01-06
Status: Merged
Approved by: Tim Peeters on 2015-01-06
Approved revision: 1373
Merged at revision: 1373
Proposed branch: lp:~gcollura/ubuntu-ui-toolkit/staging-fix-1341814-and-1400297
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 25 lines (+15/-0)
1 file modified
modules/Ubuntu/Components/PageHeadConfiguration.qml (+15/-0)
To merge this branch: bzr merge lp:~gcollura/ubuntu-ui-toolkit/staging-fix-1341814-and-1400297
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-01-06
Tim Peeters Approve on 2015-01-06
Riccardo Padovani 2015-01-06 Pending
Zoltan Balogh 2015-01-06 Pending
Review via email: mp+245645@code.launchpad.net

This proposal supersedes a proposal from 2015-01-05.

Commit Message

This is a bugfix for bug #1341814 and bug #1400297. Essentially we have to force the removal of the previous 'contents' item by removing its parent. This way we ensure that the contents are correctly hidden, focused and removed, without destroying them.

Description of the Change

This is a bugfix for bug #1341814 and bug #1400297. Essentially we have to force the removal of the previous 'contents' item by removing its parent. This way we ensure that the contents are correctly hidden, focused and removed, without destroying them.

To post a comment you must log in.
Riccardo Padovani (rpadovani) wrote : Posted in a previous version of this proposal

Tested on desktop on vivid, it fixes both bugs.

Thanks Giulio!

review: Approve
Zoltan Balogh (bzoltan) wrote : Posted in a previous version of this proposal

Would you please target this MR to the staging branch? (lp:ubuntu-ui-toolkit/staging)

review: Needs Fixing
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

Thanks a lot for the fix! Can you please rebase this with staging so that the changes from trunk don't show up in the diff?

Also,

29 + __oldContents.parent = null

add a semicolon at the end of that line, to use a consistent coding standard.

Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

21 + property Item __oldContents: null

Instead of that, I propose to introduce:

QtObject {
  id: internal
  property Item oldContents: null
}

and then use internal.oldContents instead of __oldContents in onContentsChanged. That way you really prevent developers using PageHeadStyle from accessing __oldContents.

Tim Peeters (tpeeters) wrote :

Great! All is good now, happroving.

review: Approve
review: Approve (continuous-integration)
Tim Peeters (tpeeters) wrote :

The bug is still present in RTM. There is a workaround here:

http://paste.ubuntu.com/10609646/

Since we are switching rtm to vivid soon, it is probably not worth the effort to backport the fix.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/PageHeadConfiguration.qml'
2--- modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-10-31 13:36:50 +0000
3+++ modules/Ubuntu/Components/PageHeadConfiguration.qml 2015-01-06 12:49:00 +0000
4@@ -96,6 +96,21 @@
5 */
6 property Item contents: null
7
8+ QtObject {
9+ id: internal
10+ property Item oldContents: null
11+ }
12+
13+ onContentsChanged: {
14+ if (internal.oldContents) {
15+ // FIX: bug #1341814 and #1400297
16+ // We have to force the removal of the previous head.contents
17+ // in order to show the new contents
18+ internal.oldContents.parent = null;
19+ }
20+ internal.oldContents = contents;
21+ }
22+
23 // FIXME: The example below can be much simplified using PageHeadState
24 // when bug #1345775 has been fixed.
25 /*!

Subscribers

People subscribed via source and target branches