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
=== modified file 'src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp'
--- src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-07-07 08:42:42 +0000
+++ src/Ubuntu/UbuntuToolkit/ucbottomedgeregion.cpp 2016-07-19 18:13:13 +0000
@@ -382,7 +382,7 @@
382 d->url = url;382 d->url = url;
383 Q_EMIT contentChanged(d->url);383 Q_EMIT contentChanged(d->url);
384 // invoke loader if the preload is set384 // invoke loader if the preload is set
385 if (d->bottomEdge && (d->bottomEdge->preloadContent()) && !d->url.isValid()) {385 if (d->bottomEdge && (d->bottomEdge->preloadContent()) && d->url.isValid()) {
386 d->loadContent(UCBottomEdgeRegionPrivate::LoadingUrl);386 d->loadContent(UCBottomEdgeRegionPrivate::LoadingUrl);
387 }387 }
388}388}
389389
=== added file 'tests/unit/bottomedge/ExternalContent.qml'
--- tests/unit/bottomedge/ExternalContent.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/bottomedge/ExternalContent.qml 2016-07-19 18:13:13 +0000
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18import QtQuick 2.4
19import Ubuntu.Components 1.3
20
21Rectangle {
22 objectName: "external"
23 width: parent ? parent.width : 0
24 height: parent ? parent.height : 0
25 color: UbuntuColors.silk
26}
27
028
=== added file 'tests/unit/bottomedge/PreloadContentUrl.qml'
--- tests/unit/bottomedge/PreloadContentUrl.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/bottomedge/PreloadContentUrl.qml 2016-07-19 18:13:13 +0000
@@ -0,0 +1,35 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18import QtQuick 2.4
19import Ubuntu.Components 1.3
20
21Item {
22 id: holder
23 width: units.gu(40)
24 height: units.gu(71)
25
26 BottomEdge {
27 id: bottomEdge
28 height: parent.height
29 hint.text: "Test"
30 objectName: "testItem"
31 preloadContent: true
32 contentUrl: Qt.resolvedUrl("ExternalContent.qml")
33 }
34}
35
036
=== modified file 'tests/unit/bottomedge/bottomedge.pro'
--- tests/unit/bottomedge/bottomedge.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/bottomedge/bottomedge.pro 2016-07-19 18:13:13 +0000
@@ -24,4 +24,6 @@
24 UncoveredByRegion.qml \24 UncoveredByRegion.qml \
25 OverriddenHintTrigger.qml \25 OverriddenHintTrigger.qml \
26 PreloadedContent.qml \26 PreloadedContent.qml \
27 BottomEdgeWithAction.qml27 BottomEdgeWithAction.qml \
28 PreloadContentUrl.qml \
29 ExternalContent.qml
2830
=== modified file 'tests/unit/bottomedge/tst_bottomedge.cpp'
--- tests/unit/bottomedge/tst_bottomedge.cpp 2016-07-07 15:33:34 +0000
+++ tests/unit/bottomedge/tst_bottomedge.cpp 2016-07-19 18:13:13 +0000
@@ -941,6 +941,16 @@
941 QCOMPARE(regionObjects[i++], QString("default"));941 QCOMPARE(regionObjects[i++], QString("default"));
942 }942 }
943943
944 void test_preload_content_url()
945 {
946 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadContentUrl.qml"));
947 UCBottomEdge *bottomEdge = test->testItem();
948
949 // commit so the contentItem is set
950 bottomEdge->commit();
951 QTRY_VERIFY(bottomEdge->contentItem());
952 }
953
944 void test_reset_preload_content()954 void test_reset_preload_content()
945 {955 {
946 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadedContent.qml"));956 QScopedPointer<BottomEdgeTestCase> test(new BottomEdgeTestCase("PreloadedContent.qml"));

Subscribers

People subscribed via source and target branches