Merge lp:~mardy/unity8/lp1433442 into lp:unity8

Proposed by Alberto Mardegan
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1919
Merged at revision: 1923
Proposed branch: lp:~mardy/unity8/lp1433442
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/previews_in_order
Diff against target: 15 lines (+2/-2)
1 file modified
qml/Dash/PreviewListView.qml (+2/-2)
To merge this branch: bzr merge lp:~mardy/unity8/lp1433442
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+268218@code.launchpad.net

This proposal supersedes a proposal from 2015-08-14.

Commit message

Set currentIndex after the model change is completed

When setting the model, the list view will first emit the countChanged signal, then will change the currentIndex to 0 (see QtDeclarative git commit 22c6873 and https://bugreports.qt.io/browse/QTBUG-26604), and finally will emit the modelChanged signal.
If we set the currentIndex in the onCountChanged handler (as we were doing
before), the currentIndex would be reset to 0 shortly afterwards.

For some mysterious reason, the desired delegate was anyway shown until the bugfix for bug 1433442 was introduced; with that bugfix, the listview is more consistent and shows the delegate corresponding to the currentIndex.

Description of the change

Set currentIndex after the model change is completed

When setting the model, the list view will first emit the countChanged signal, then will change the currentIndex to 0 (see QtDeclarative git commit 22c6873 and https://bugreports.qt.io/browse/QTBUG-26604), and finally will emit the modelChanged signal.
If we set the currentIndex in the onCountChanged handler (as we were doing
before), the currentIndex would be reset to 0 shortly afterwards.

For some mysterious reason, the desired delegate was anyway shown until the bugfix for bug 1433442 was introduced; with that bugfix, the listview is more consistent and shows the delegate corresponding to the currentIndex.

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

No, although this change is mostly relevant when using libqt5quick5 from silo 29 (because without this change, that silo would cause a regression).

 * 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?

It isn't.

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

No visible UI changes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

This is actually regressing (without the silo 29).

Is silo 29 ready/testable already?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

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

 * Did CI run pass?
It's kaboomed

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

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/PreviewListView.qml'
2--- qml/Dash/PreviewListView.qml 2015-08-17 11:46:35 +0000
3+++ qml/Dash/PreviewListView.qml 2015-08-17 11:46:35 +0000
4@@ -86,10 +86,10 @@
5 }
6 }
7
8- onCountChanged: {
9+ onModelChanged: {
10 if (count > 0 && initialIndex >= 0 && !usedInitialIndex) {
11 usedInitialIndex = true;
12- currentIndex = initialIndex;
13+ previewListView.positionViewAtIndex(initialIndex, ListView.SnapPosition);
14 }
15 }
16

Subscribers

People subscribed via source and target branches