on xenial help sign in
WIP - still need to fix AP tests, add tests for scope settings, try not-boolean settings
commit00bf0b3ddc52a4d3694a497ff38eb78605e7c3a1 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 7 Aug 2014, 17:13 (12 years ago) parent7577e0d
12 files changed+486−45
qml/Components/PageHeader.qml+10 qml/Dash/GenericScopeView.qml+81−20 qml/Dash/PreviewListView.qml+3−1 qml/Dash/ScopeSettings/ScopeSetting.qml+36 qml/Dash/ScopeSettings/ScopeSettingLabel.qml+51 qml/Dash/ScopeSettings/ScopeSettingList.qml+37 qml/Dash/ScopeSettings/ScopeSettingNumber.qml+52 qml/Dash/ScopeSettings/ScopeSettingSwitch.qml+48 qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qml+55 qml/Dash/ScopeSettings/ScopeSettings.qml+35 qml/Dash/ScopeSettingsPage.qml+54 tests/qmltests/Dash/tst_GenericScopeView.qml+24−24
qml/Components/PageHeader.qml+10
@@ -30,6 +30,7 @@ Item {
3030 property string title
3131
3232 property bool searchEntryEnabled: false
33+ property bool settingsEnabled: false
3334 property ListModel searchHistory: SearchHistoryModel
3435 property alias searchQuery: searchTextField.text
3536 property bool searchInProgress: false
@@ -43,6 +44,8 @@ Item {
4344
4445 signal backClicked()
4546
47+ signal settingsClicked()
48+
4649 onScopeStyleChanged: refreshLogo()
4750 onSearchQueryChanged: {
4851 // Make sure we are at the search page if the search query changes behind our feet
@@ -267,6 +270,13 @@ Item {
267270 headerContainer.showSearch = true;
268271 searchTextField.forceActiveFocus();
269272 }
273+ },
274+ Action {
275+ iconName: "settings"
276+ visible: root.settingsEnabled
277+ onTriggered: {
278+ root.settingsClicked()
279+ }
270280 }
271281 ]
272282 }
qml/Dash/GenericScopeView.qml+81−20
@@ -58,13 +58,13 @@ FocusScope {
5858 }
5959
6060 function closePreview() {
61− previewListView.open = false;
61+ subPageLoader.closeSubPage()
6262 }
6363
6464 Binding {
6565 target: scope
6666 property: "isActive"
67− value: isCurrent && !previewListView.open
67+ value: isCurrent && !subPageLoader.open
6868 }
6969
7070 SortFilterProxyModel {
@@ -78,7 +78,7 @@ FocusScope {
7878
7979 onIsCurrentChanged: {
8080 pageHeader.resetSearch();
81− previewListView.open = false;
81+ subPageLoader.closeSubPage();
8282 }
8383
8484 Binding {
@@ -97,8 +97,8 @@ FocusScope {
9797
9898 Connections {
9999 target: scopeView.scope
100− onShowDash: previewListView.open = false;
101− onHideDash: previewListView.open = false;
100+ onShowDash: subPageLoader.closeSubPage()
101+ onHideDash: subPageLoader.closeSubPage()
102102 }
103103
104104 Rectangle {
@@ -111,13 +111,13 @@ FocusScope {
111111 id: categoryView
112112 objectName: "categoryListView"
113113
114− x: previewListView.open ? -width : 0
114+ x: subPageLoader.open ? -width : 0
115115 Behavior on x { UbuntuNumberAnimation { } }
116116 width: parent.width
117117 height: parent.height
118118
119119 model: scopeView.categories
120− forceNoClip: previewListView.open
120+ forceNoClip: subPageLoader.open
121121 pixelAligned: true
122122
123123 property string expandedCategoryId: ""
@@ -238,13 +238,14 @@ FocusScope {
238238 if (!rendererLoader.expanded && !seeAllLabel.visible && target.collapsedItemCount > 0) {
239239 previewLimitModel.model = target.model;
240240 previewLimitModel.limit = target.collapsedItemCount;
241− previewListView.model = previewLimitModel;
241+ subPageLoader.model = previewLimitModel;
242242 } else {
243− previewListView.model = target.model;
243+ subPageLoader.model = target.model;
244244 }
245− previewListView.currentIndex = -1;
246− previewListView.currentIndex = index;
247− previewListView.open = true;
245+ subPageLoader.currentIndex = -1;
246+ subPageLoader.currentIndex = index;
247+ subPageLoader.subPage = "preview";
248+ subPageLoader.openSubPage();
248249 }
249250 }
250251 Connections {
@@ -260,10 +261,10 @@ FocusScope {
260261 // If the filter animation will be seen start it, otherwise, just flip the switch
261262 var shrinkingVisible = !shouldExpand && y + item.collapsedHeight + seeAll.height < categoryView.height;
262263 var growingVisible = shouldExpand && y + height < categoryView.height;
263− if (!previewListView.open || shouldExpand) {
264+ if (!subPageLoader.open || shouldExpand) {
264265 var animate = shrinkingVisible || growingVisible;
265266 baseItem.expand(shouldExpand, animate)
266− if (shouldExpand && !previewListView.open) {
267+ if (shouldExpand && !subPageLoader.open) {
267268 categoryView.maximizeVisibleArea(index, item.expandedHeight + seeAll.height);
268269 }
269270 }
@@ -388,6 +389,7 @@ FocusScope {
388389 showBackButton: scopeView.hasBackAction
389390 searchEntryEnabled: true
390391 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
392+ settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
391393 scopeStyle: scopeView.scopeStyle
392394
393395 bottomItem: DashDepartments {
@@ -400,6 +402,11 @@ FocusScope {
400402 }
401403
402404 onBackClicked: scopeView.backClicked()
405+
406+ onSettingsClicked: {
407+ subPageLoader.subPage = "settings";
408+ subPageLoader.openSubPage();
409+ }
403410 }
404411 }
405412
@@ -407,19 +414,73 @@ FocusScope {
407414 id: previewLimitModel
408415 }
409416
410− PreviewListView {
411− id: previewListView
412− objectName: "previewListView"
417+ Loader {
418+ id: subPageLoader
419+ objectName: "subPageLoader"
413420 visible: x != width
414− scope: scopeView.scope
415− scopeStyle: scopeView.scopeStyle
416421 width: parent.width
417422 height: parent.height
418423 anchors.left: categoryView.right
419424
425+ property bool open: false
426+ property var scope: scopeView.scope
427+ property var scopeStyle: scopeView.scopeStyle
428+ property int currentIndex: -1
429+ property var model: null
430+
431+ property string subPage: ""
432+
433+ function updateBindings() {
434+ if (status === Loader.Ready) {
435+ item.scope = Qt.binding(function() { return subPageLoader.scope } )
436+ item.scopeStyle = Qt.binding(function() { return subPageLoader.scopeStyle } )
437+ if (item.hasOwnProperty("open")) item.open = Qt.binding(function() { return subPageLoader.open } )
438+ if (item.hasOwnProperty("currentIndex")) item.currentIndex = Qt.binding(function() { return subPageLoader.currentIndex } )
439+ if (item.hasOwnProperty("model")) item.model = Qt.binding(function() { return subPageLoader.model } )
440+ }
441+ }
442+
443+ function updateSource() {
444+ switch (subPage) {
445+ case "preview": source = "PreviewListView.qml"; break;
446+ case "settings": source = "ScopeSettingsPage.qml"; break;
447+ default: source = ""; break;
448+ }
449+ }
450+
451+ function openSubPage() {
452+ // FIXME adding the following check before opening makes more sense to me,
453+ // but it doesn't seem to work in qmltestrunner::GenericScopeView::test_previewOpenClose()
454+ // if (!visible && status === Loader.Ready), x is different to width.
455+ // Let's just check status for now.
456+ if (status === Loader.Ready) open = true;
457+ }
458+
459+ function closeSubPage() {
460+ open = false;
461+ subPage = "";
462+ }
463+
464+ onSubPageChanged: {
465+ // let's update the source only when the loader is not visible
466+ if (!visible) updateSource();
467+ }
468+
469+ onVisibleChanged: {
470+ // let's update the source only when the loader is not visible
471+ if (!visible) updateSource();
472+ }
473+
474+ onLoaded: updateBindings()
475+
420476 onOpenChanged: {
477+ if (open) updateBindings();
421478 pageHeader.unfocus();
422479 }
423− }
424480
481+ Connections {
482+ target: subPageLoader.item
483+ onBackClicked: subPageLoader.closeSubPage()
484+ }
485+ }
425486}
qml/Dash/PreviewListView.qml+3−1
@@ -32,6 +32,8 @@ Item {
3232 property alias currentItem: previewListView.currentItem
3333 property alias count: previewListView.count
3434
35+ signal backClicked()
36+
3537 PageHeader {
3638 id: header
3739 objectName: "pageHeader"
@@ -41,7 +43,7 @@ Item {
4143 searchEntryEnabled: false
4244 scopeStyle: root.scopeStyle
4345
44− onBackClicked: root.open = false
46+ onBackClicked: root.backClicked()
4547 }
4648
4749 ListView {
qml/Dash/ScopeSettings/ScopeSetting.qmlnew file+36
@@ -0,0 +1,36 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+/*! Interface for settings widgets. */
21+
22+Item {
23+ //! The ScopeStyle component.
24+ property var scopeStyle: null
25+
26+ //! Variable used to contain widget's data
27+ property var widgetData: null
28+
29+ readonly property real __margins: units.gu(2)
30+
31+ /*! \brief This signal should be emitted when a setting action was triggered.
32+ *
33+ * \param new value
34+ */
35+ signal triggered(var value)
36+}
qml/Dash/ScopeSettings/ScopeSettingLabel.qmlnew file+51
@@ -0,0 +1,51 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+ScopeSetting {
21+ id: root
22+ implicitHeight: units.gu(6)
23+
24+ Label {
25+ anchors {
26+ left: parent.left
27+ leftMargin: __margins
28+ right: control.left
29+ rightMargin: units.gu(1)
30+ verticalCenter: parent.verticalCenter
31+ }
32+ text: widgetData.displayName
33+ elide: Text.ElideMiddle
34+ color: scopeStyle ? scopeStyle.foreground : "grey"
35+ }
36+
37+ TextField {
38+ id: control
39+ anchors {
40+ right: parent.right
41+ rightMargin: __margins
42+ verticalCenter: parent.verticalCenter
43+ }
44+ text: widgetData.value
45+
46+ onTriggered: root.triggered(text)
47+ onActiveFocusChanged: {
48+ if (!activeFocus) root.triggered(text);
49+ }
50+ }
51+}
qml/Dash/ScopeSettings/ScopeSettingList.qmlnew file+37
@@ -0,0 +1,37 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+ScopeSetting {
21+ id: root
22+ implicitHeight: optionSelector.implicitHeight
23+
24+ OptionSelector {
25+ id: optionSelector
26+ anchors {
27+ left: parent.left
28+ right: parent.right
29+ top: parent.top
30+ margins: __margins
31+ }
32+ text: widgetData.displayName
33+ model: widgetData.properties["values"]
34+
35+ onSelectedIndexChanged: root.triggered(selectedIndex)
36+ }
37+}
qml/Dash/ScopeSettings/ScopeSettingNumber.qmlnew file+52
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+ScopeSetting {
21+ id: root
22+ implicitHeight: units.gu(6)
23+
24+ Label {
25+ anchors {
26+ left: parent.left
27+ leftMargin: __margins
28+ right: control.left
29+ rightMargin: units.gu(1)
30+ verticalCenter: parent.verticalCenter
31+ }
32+ text: widgetData.displayName
33+ elide: Text.ElideMiddle
34+ color: scopeStyle ? scopeStyle.foreground : "grey"
35+ }
36+
37+ TextField {
38+ id: control
39+ anchors {
40+ right: parent.right
41+ rightMargin: __margins
42+ verticalCenter: parent.verticalCenter
43+ }
44+ text: widgetData.value
45+ validator: DoubleValidator {}
46+
47+ onTriggered: root.triggered(text)
48+ onActiveFocusChanged: {
49+ if (!activeFocus) root.triggered(text);
50+ }
51+ }
52+}
qml/Dash/ScopeSettings/ScopeSettingSwitch.qmlnew file+48
@@ -0,0 +1,48 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+ScopeSetting {
21+ id: root
22+ implicitHeight: units.gu(6)
23+
24+ Label {
25+ anchors {
26+ left: parent.left
27+ leftMargin: __margins
28+ right: control.left
29+ rightMargin: units.gu(1)
30+ verticalCenter: parent.verticalCenter
31+ }
32+ text: widgetData.displayName
33+ elide: Text.ElideMiddle
34+ color: scopeStyle ? scopeStyle.foreground : "grey"
35+ }
36+
37+ Switch {
38+ id: control
39+ anchors {
40+ right: parent.right
41+ rightMargin: __margins
42+ verticalCenter: parent.verticalCenter
43+ }
44+ checked: widgetData.value
45+
46+ onTriggered: root.triggered(checked)
47+ }
48+}
qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qmlnew file+55
@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+
19+//! \brief This component loads the widgets based on type.
20+
21+Loader {
22+ id: root
23+
24+ //! The ScopeStyle component.
25+ property var scopeStyle: null
26+
27+ //! Variable used to contain widget's data
28+ property var widgetData: null
29+
30+ //! Triggered signal forwarded from the widgets.
31+ signal triggered(var value)
32+
33+ source: widgetSource
34+
35+ //! \cond private
36+ property url widgetSource: {
37+ switch (widgetData.type) {
38+ case "boolean": return "ScopeSettingSwitch.qml";
39+ case "list": return "ScopeSettingSwitch.qml";
40+ case "number": return "ScopeSettingNumber.qml";
41+ case "string": return "ScopeSettingLabel.qml";
42+ default: return "";
43+ }
44+ }
45+ //! \endcond
46+
47+ onLoaded: {
48+ item.widgetData = Qt.binding(function() { return root.widgetData } )
49+ }
50+
51+ Connections {
52+ target: root.item
53+ onTriggered: root.triggered(value)
54+ }
55+}
qml/Dash/ScopeSettings/ScopeSettings.qmlnew file+35
@@ -0,0 +1,35 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+
20+ListView {
21+ //! The ScopeStyle component.
22+ property var scopeStyle: null
23+
24+ orientation: ListView.Vertical
25+
26+ delegate: ScopeSettingWidgetFactory {
27+ objectName: "scopeSettingItem" + index
28+ width: root.width
29+ widgetData: model
30+ scopeStyle: root.scopeStyle
31+
32+ onTriggered: model.value = value;
33+ }
34+}
35+
qml/Dash/ScopeSettingsPage.qmlnew file+54
@@ -0,0 +1,54 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
19+import Unity 0.2
20+import "../Components"
21+import "ScopeSettings"
22+
23+Item {
24+ id: root
25+
26+ property var scope: null
27+ property var scopeStyle: null
28+
29+ signal backClicked()
30+
31+ PageHeader {
32+ id: header
33+ objectName: "pageHeader"
34+ width: parent.width
35+ title: scope ? scope.name : ""
36+ showBackButton: true
37+ searchEntryEnabled: false
38+ scopeStyle: root.scopeStyle || undefined
39+
40+ onBackClicked: root.backClicked()
41+ }
42+
43+ ScopeSettings {
44+ id: scopeSettings
45+ objectName: "scopeSettings"
46+ anchors {
47+ top: header.bottom
48+ bottom: parent.bottom
49+ left: parent.left
50+ right: parent.right
51+ }
52+ model: root.scope ? root.scope.settings : null
53+ }
54+}
tests/qmltests/Dash/tst_GenericScopeView.qml+24−24
@@ -57,7 +57,7 @@ Item {
5757 name: "GenericScopeView"
5858 when: scopes.loaded && windowShown
5959
60− property Item previewListView: findChild(genericScopeView, "previewListView")
60+ property Item subPageLoader: findChild(genericScopeView, "subPageLoader")
6161 property Item header: findChild(genericScopeView, "scopePageHeader")
6262
6363 function init() {
@@ -78,24 +78,24 @@ Item {
7878 tryCompare(genericScopeView.scope, "isActive", false)
7979 genericScopeView.isCurrent = true
8080 tryCompare(genericScopeView.scope, "isActive", true)
81− testCase.previewListView.open = true
81+ testCase.subPageLoader.open = true
8282 tryCompare(genericScopeView.scope, "isActive", false)
83− testCase.previewListView.open = false
83+ testCase.subPageLoader.open = false
8484 tryCompare(genericScopeView.scope, "isActive", true)
8585 genericScopeView.isCurrent = false
8686 tryCompare(genericScopeView.scope, "isActive", false)
8787 }
8888
8989 function test_showDash() {
90− testCase.previewListView.open = true;
90+ testCase.subPageLoader.open = true;
9191 scopes.getScope(1).showDash();
92− tryCompare(testCase.previewListView, "open", false);
92+ tryCompare(testCase.subPageLoader, "open", false);
9393 }
9494
9595 function test_hideDash() {
96− testCase.previewListView.open = true;
96+ testCase.subPageLoader.open = true;
9797 scopes.getScope(1).hideDash();
98− tryCompare(testCase.previewListView, "open", false);
98+ tryCompare(testCase.subPageLoader, "open", false);
9999 }
100100
101101 function test_searchQuery() {
@@ -196,7 +196,7 @@ Item {
196196
197197 openPreview(4, 0);
198198
199− compare(testCase.previewListView.count, 12, "There should only be 12 items in preview.");
199+ compare(testCase.subPageLoader.item.count, 12, "There should only be 12 items in preview.");
200200 }
201201
202202 function test_narrow_delegate_ranges_expand() {
@@ -257,19 +257,19 @@ Item {
257257 true);
258258 var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate);
259259 mouseClick(tile, tile.width / 2, tile.height / 2);
260− tryCompare(testCase.previewListView, "open", true);
261− tryCompare(testCase.previewListView, "x", 0);
260+ tryCompare(testCase.subPageLoader, "open", true);
261+ tryCompare(testCase.subPageLoader, "x", 0);
262262 }
263263
264264 function closePreview() {
265− var closePreviewMouseArea = findChild(genericScopeView, "innerPageHeader");
265+ var closePreviewMouseArea = findChild(subPageLoader.item, "pageHeader");
266266 mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2));
267267
268− tryCompare(testCase.previewListView, "open", false);
268+ tryCompare(testCase.subPageLoader, "open", false);
269269 }
270270
271271 function test_previewOpenClose() {
272− tryCompare(testCase.previewListView, "open", false);
272+ tryCompare(testCase.subPageLoader, "open", false);
273273
274274 var categoryListView = findChild(genericScopeView, "categoryListView");
275275 categoryListView.positionAtBeginning();
@@ -289,15 +289,15 @@ Item {
289289 },
290290 true);
291291
292− tryCompare(testCase.previewListView, "open", false);
292+ tryCompare(testCase.subPageLoader, "open", false);
293293
294294 var dashCategory1 = findChild(genericScopeView, "dashCategory1");
295295 var tile = findChild(dashCategory1, "carouselDelegate1");
296296 mouseClick(tile, tile.width / 2, tile.height / 2);
297297 tryCompare(tile, "explicitlyScaled", true);
298298 mouseClick(tile, tile.width / 2, tile.height / 2);
299− tryCompare(testCase.previewListView, "open", true);
300− tryCompare(testCase.previewListView, "x", 0);
299+ tryCompare(testCase.subPageLoader, "open", true);
300+ tryCompare(testCase.subPageLoader, "x", 0);
301301
302302 closePreview();
303303 }
@@ -306,20 +306,20 @@ Item {
306306 var categoryListView = findChild(genericScopeView, "categoryListView");
307307 categoryListView.positionAtBeginning();
308308
309− tryCompare(testCase.previewListView, "open", false);
310− var previewListViewList = findChild(previewListView, "listView");
309+ tryCompare(testCase.subPageLoader, "open", false);
311310
312311 openPreview();
312+ var previewListViewList = findChild(subPageLoader.item, "listView");
313313
314314 // flick to the next previews
315− tryCompare(testCase.previewListView, "count", 15);
316− for (var i = 1; i < testCase.previewListView.count; ++i) {
317− mouseFlick(testCase.previewListView, testCase.previewListView.width - units.gu(1),
318− testCase.previewListView.height / 2,
315+ tryCompare(testCase.subPageLoader.item, "count", 15);
316+ for (var i = 1; i < testCase.subPageLoader.item.count; ++i) {
317+ mouseFlick(testCase.subPageLoader.item, testCase.subPageLoader.item.width - units.gu(1),
318+ testCase.subPageLoader.item.height / 2,
319319 units.gu(2),
320− testCase.previewListView.height / 2);
320+ testCase.subPageLoader.item.height / 2);
321321 tryCompare(previewListViewList, "moving", false);
322− tryCompare(testCase.previewListView.currentItem, "objectName", "previewItem" + i);
322+ tryCompare(testCase.subPageLoader.item.currentItem, "objectName", "previewItem" + i);
323323
324324 }
325325 closePreview();