Merge lp:~faenil/ubuntu-ui-toolkit/slotslayout_implicitwidthloop_bug1630167 into lp:ubuntu-ui-toolkit/staging

Proposed by Andrea Bernabei
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 2108
Merged at revision: 2139
Proposed branch: lp:~faenil/ubuntu-ui-toolkit/slotslayout_implicitwidthloop_bug1630167
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 60 lines (+32/-1)
2 files modified
src/UbuntuToolkit/ucslotslayout.cpp (+4/-1)
tests/unit/visual/tst_slotslayout.13.qml (+28/-0)
To merge this branch: bzr merge lp:~faenil/ubuntu-ui-toolkit/slotslayout_implicitwidthloop_bug1630167
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) (community) Approve
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Zsombor Egri Pending
Review via email: mp+307956@code.launchpad.net

Commit message

SlotsLayout: do not set mainSlot's implicitSize, set its real size instead

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

> console.log("Bug #1630167 if no ouput after this line")

For the record, I was going to ask "Who is going to read that?" but realized that the test will be generating a warning
WARNING **: Timing out at maximum wait of 500 seconds
which does fail the test (verified locally).

So, looking good!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Ok yakkety hopefully fixed now, retopapproving.

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Confirmed working fine (and fixing the infinte loop) also in my test case.

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/UbuntuToolkit/ucslotslayout.cpp'
--- src/UbuntuToolkit/ucslotslayout.cpp 2016-09-27 16:55:03 +0000
+++ src/UbuntuToolkit/ucslotslayout.cpp 2016-10-07 14:35:32 +0000
@@ -540,7 +540,10 @@
540 qmlInfo(q) << "Invalid attached property!";540 qmlInfo(q) << "Invalid attached property!";
541 return;541 return;
542 }542 }
543 mainSlot->setImplicitWidth(q->width() - totalSlotsWidth543 //bug#1630167: set width instead of implicitWidth to avoid clashing with internal logic of the
544 //component which is inside the mainSlot (e.g. Column and positioners handle the implicit width
545 //themselves)
546 mainSlot->setWidth(q->width() - totalSlotsWidth
544 - attachedProps->padding()->leading()547 - attachedProps->padding()->leading()
545 - attachedProps->padding()->trailing()548 - attachedProps->padding()->trailing()
546 - padding.leading() - padding.trailing());549 - padding.leading() - padding.trailing());
547550
=== modified file 'tests/unit/visual/tst_slotslayout.13.qml'
--- tests/unit/visual/tst_slotslayout.13.qml 2016-09-27 21:49:47 +0000
+++ tests/unit/visual/tst_slotslayout.13.qml 2016-10-07 14:35:32 +0000
@@ -317,6 +317,26 @@
317 }317 }
318 }318 }
319319
320 Component {
321 id: mainSlotImplicitWidthComponent
322 SlotsLayout {
323 id: mainSlotImplicitSizeTest
324 //by forcing 2gu width and 2gu+2gu padding we force the mainSlot to have a negative size
325 //which is the condition that triggers bug #1630167
326 width: units.gu(2)
327 padding {
328 leading: units.gu(2)
329 trailing: units.gu(2)
330 }
331 mainSlot: Column {
332 Item {
333 width: parent.width
334 height: 5
335 }
336 }
337 }
338 }
339
320 UbuntuTestCase {340 UbuntuTestCase {
321 name: "SlotsLayout"341 name: "SlotsLayout"
322 when: windowShown342 when: windowShown
@@ -985,5 +1005,13 @@
985 "Multiline labels positioning: wrong summary lineCount")1005 "Multiline labels positioning: wrong summary lineCount")
986 checkLabelsY(layoutMultilineLabels)1006 checkLabelsY(layoutMultilineLabels)
987 }1007 }
1008
1009 //Bug #1630167: this test will trigger an endless loop in case of regression
1010 function test_implicitMainSlotWidthLoop() {
1011 console.log("Bug #1630167 if no ouput after this line")
1012 var obj = mainSlotImplicitWidthComponent.createObject(main);
1013 waitForRendering(obj);
1014 verify(obj !== null, "test_implicitMainSlotWidthLoop, dynamic object creation.");
1015 }
988 }1016 }
989}1017}

Subscribers

People subscribed via source and target branches