Merge lp:~tpeeters/ubuntu-ui-toolkit/qt56fixes1 into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 2094
Merged at revision: 2093
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/qt56fixes1
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 77 lines (+34/-2)
4 files modified
src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml (+0/-1)
src/Ubuntu/UbuntuToolkit/ucaction.cpp (+8/-0)
tests/unit/components/tst_action.qml (+26/-0)
tests/unit/visual/tst_actionbar.13.qml (+0/-1)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/qt56fixes1
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+305109@code.launchpad.net

Commit message

Improve the initialization of Action when it gets both iconName and iconSource from an external component when iconSource is undefined. This fixes the some times missing overflow button in the ActionBar with Qt 5.6.

I also removed action: modelData from the OverflowPanel because this is already set automatically in ActionSelectionPopover after everything is initialized. That fixes a ReferenceError in OverflowPanel with Qt 5.6.

Description of the change

The ReferenceError that was fixed is part 1 of the bug report. The initialization of Action is part 2 of the bug report.

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
Cris Dywan (kalikiana) wrote :

Looks sensible. Thanks!

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: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

retopapproving because of arale phone failure

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)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml'
2--- src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml 2016-03-30 15:12:36 +0000
3+++ src/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml 2016-09-07 14:40:45 +0000
4@@ -63,7 +63,6 @@
5
6 delegate: AbstractButton {
7 id: actionButton
8- action: modelData
9
10 // close after triggering the action.
11 onClicked: overflow.hide()
12
13=== modified file 'src/Ubuntu/UbuntuToolkit/ucaction.cpp'
14--- src/Ubuntu/UbuntuToolkit/ucaction.cpp 2016-08-25 14:00:43 +0000
15+++ src/Ubuntu/UbuntuToolkit/ucaction.cpp 2016-09-07 14:40:45 +0000
16@@ -364,6 +364,14 @@
17 if (m_iconSource == url) {
18 return;
19 }
20+ if (url.isEmpty() && m_factoryIconSource) {
21+ // Prevent overriding iconSource when it is a binding to a property with
22+ // an empty value at initialization, and the value of iconName is initialized
23+ // before iconSource is initialized which would cause first iconSource to be set,
24+ // and after that iconSource to be reset to the empty value of the binding.
25+ // Fixes bug #1616858.
26+ return;
27+ }
28 m_iconSource = url;
29 m_factoryIconSource = false;
30 Q_EMIT iconSourceChanged();
31
32=== modified file 'tests/unit/components/tst_action.qml'
33--- tests/unit/components/tst_action.qml 2016-06-24 13:07:32 +0000
34+++ tests/unit/components/tst_action.qml 2016-09-07 14:40:45 +0000
35@@ -342,4 +342,30 @@
36 }
37 }
38
39+ QtObject {
40+ id: styleProperties
41+ property string iconName: "contact"
42+ property string iconSource
43+ }
44+ Action {
45+ id: actionWithPropertiesFromStyle
46+ iconName: styleProperties.iconName
47+ iconSource: styleProperties.iconSource
48+ property int numIconSourceChanged: 0
49+ onIconSourceChanged: numIconSourceChanged++
50+ }
51+ function test_icon_name_and_source_from_style_bug1616858() {
52+ compare(actionWithPropertiesFromStyle.iconName, "contact",
53+ "iconName not properly copied from style.");
54+ compare(actionWithPropertiesFromStyle.iconSource, "image://theme/contact",
55+ "iconSource not properly set with an undefined iconSource from style.");
56+ compare(actionWithPropertiesFromStyle.numIconSourceChanged, 1,
57+ "iconSource did not update exactly once.");
58+ var newIconSource = Qt.resolvedUrl("../../../examples/ubuntu-ui-toolkit-gallery/small_avatar.png")
59+ styleProperties.iconSource = newIconSource;
60+ compare(actionWithPropertiesFromStyle.iconSource, newIconSource,
61+ "Failed to update iconSource from style properly.");
62+ compare(actionWithPropertiesFromStyle.numIconSourceChanged, 2,
63+ "Incorrect number of updates to icon source.");
64+ }
65 }
66
67=== modified file 'tests/unit/visual/tst_actionbar.13.qml'
68--- tests/unit/visual/tst_actionbar.13.qml 2016-08-25 12:28:58 +0000
69+++ tests/unit/visual/tst_actionbar.13.qml 2016-09-07 14:40:45 +0000
70@@ -296,7 +296,6 @@
71 compare(bar.actions, root.shortActionList, "Actions property can be updated.");
72 }
73
74-
75 function test_actions_visibility_data() {
76 // bar has 11 actions, shortBar has 2 actions.
77 return [

Subscribers

People subscribed via source and target branches