Merge lp:~zsombi/ubuntu-ui-toolkit/pleaseBottomEdgePreloadUrl into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Tim Peeters
Approved revision: 2037
Merged at revision: 2036
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/pleaseBottomEdgePreloadUrl
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 117 lines (+76/-2)
5 files modified
src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp (+1/-1)
tests/unit/bottomedge/ExternalContent.qml (+27/-0)
tests/unit/bottomedge/PreloadContentUrl.qml (+35/-0)
tests/unit/bottomedge/bottomedge.pro (+3/-1)
tests/unit/bottomedge/tst_bottomedge.cpp (+10/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/pleaseBottomEdgePreloadUrl
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Tim Peeters Approve
Andrew Hayzen (community) functional Approve
Review via email: mp+300509@code.launchpad.net

Commit message

Fix BottomEdge content URL preloading.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

This resolves the issue stated in the bug report :-)

review: Approve (functional)
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
Tim Peeters (tpeeters) wrote :

Thanks Andrew for reporting and testing and thanks Zsombor for fixing :)

review: Approve
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/UbuntuToolkit/ucbottomedgeregion.cpp'
2--- src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-07-07 08:42:42 +0000
3+++ src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-07-19 18:13:13 +0000
4@@ -382,7 +382,7 @@
5 d->url = url;
6 Q_EMIT contentChanged(d->url);
7 // invoke loader if the preload is set
8- if (d->bottomEdge && (d->bottomEdge->preloadContent()) && !d->url.isValid()) {
9+ if (d->bottomEdge && (d->bottomEdge->preloadContent()) && d->url.isValid()) {
10 d->loadContent(UCBottomEdgeRegionPrivate::LoadingUrl);
11 }
12 }
13
14=== added file 'tests/unit/bottomedge/ExternalContent.qml'
15--- tests/unit/bottomedge/ExternalContent.qml 1970-01-01 00:00:00 +0000
16+++ tests/unit/bottomedge/ExternalContent.qml 2016-07-19 18:13:13 +0000
17@@ -0,0 +1,27 @@
18+/*
19+ * Copyright 2016 Canonical Ltd.
20+ *
21+ * This program is free software; you can redistribute it and/or modify
22+ * it under the terms of the GNU Lesser General Public License as published by
23+ * the Free Software Foundation; version 3.
24+ *
25+ * This program is distributed in the hope that it will be useful,
26+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+ * GNU Lesser General Public License for more details.
29+ *
30+ * You should have received a copy of the GNU Lesser General Public License
31+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32+ *
33+ */
34+
35+import QtQuick 2.4
36+import Ubuntu.Components 1.3
37+
38+Rectangle {
39+ objectName: "external"
40+ width: parent ? parent.width : 0
41+ height: parent ? parent.height : 0
42+ color: UbuntuColors.silk
43+}
44+
45
46=== added file 'tests/unit/bottomedge/PreloadContentUrl.qml'
47--- tests/unit/bottomedge/PreloadContentUrl.qml 1970-01-01 00:00:00 +0000
48+++ tests/unit/bottomedge/PreloadContentUrl.qml 2016-07-19 18:13:13 +0000
49@@ -0,0 +1,35 @@
50+/*
51+ * Copyright 2016 Canonical Ltd.
52+ *
53+ * This program is free software; you can redistribute it and/or modify
54+ * it under the terms of the GNU Lesser General Public License as published by
55+ * the Free Software Foundation; version 3.
56+ *
57+ * This program is distributed in the hope that it will be useful,
58+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
59+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60+ * GNU Lesser General Public License for more details.
61+ *
62+ * You should have received a copy of the GNU Lesser General Public License
63+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
64+ *
65+ */
66+
67+import QtQuick 2.4
68+import Ubuntu.Components 1.3
69+
70+Item {
71+ id: holder
72+ width: units.gu(40)
73+ height: units.gu(71)
74+
75+ BottomEdge {
76+ id: bottomEdge
77+ height: parent.height
78+ hint.text: "Test"
79+ objectName: "testItem"
80+ preloadContent: true
81+ contentUrl: Qt.resolvedUrl("ExternalContent.qml")
82+ }
83+}
84+
85
86=== modified file 'tests/unit/bottomedge/bottomedge.pro'
87--- tests/unit/bottomedge/bottomedge.pro 2016-05-31 09:02:35 +0000
88+++ tests/unit/bottomedge/bottomedge.pro 2016-07-19 18:13:13 +0000
89@@ -24,4 +24,6 @@
90 UncoveredByRegion.qml \
91 OverriddenHintTrigger.qml \
92 PreloadedContent.qml \
93- BottomEdgeWithAction.qml
94+ BottomEdgeWithAction.qml \
95+ PreloadContentUrl.qml \
96+ ExternalContent.qml
97
98=== modified file 'tests/unit/bottomedge/tst_bottomedge.cpp'
99--- tests/unit/bottomedge/tst_bottomedge.cpp 2016-07-07 15:33:34 +0000
100+++ tests/unit/bottomedge/tst_bottomedge.cpp 2016-07-19 18:13:13 +0000
101@@ -941,6 +941,16 @@
102 QCOMPARE(regionObjects[i++], QString("default"));
103 }
104
105+ void test_preload_content_url()
106+ {
107+ QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadContentUrl.qml"));
108+ UCBottomEdge *bottomEdge = test->testItem();
109+
110+ // commit so the contentItem is set
111+ bottomEdge->commit();
112+ QTRY_VERIFY(bottomEdge->contentItem());
113+ }
114+
115 void test_reset_preload_content()
116 {
117 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadedContent.qml"));

Subscribers

People subscribed via source and target branches