on xenial help sign in
Merge
2e81799Albert Astals Cid
CMakeLists.txt+3
@@ -58,6 +58,9 @@ find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
60pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
61+pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63+pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
61
64
62# Standard install paths
65# Standard install paths
63include(GNUInstallDirs)
66include(GNUInstallDirs)
debian/changelog+19
@@ -1,3 +1,22 @@
1+unity8 (8.11+16.04.20160208-0ubuntu1) xenial; urgency=medium
2+
3+ [ Albert Astals Cid ]
4+ * LVWPH: Reset to initial values when list is empty (LP: #1540490)
5+ * Make LazyImage qmltest less flaky on CI
6+
7+ [ Andrea Cimitan ]
8+ * Make LazyImage qmltest less flaky on CI
9+
10+ [ CI Train Bot ]
11+ * Resync trunk.
12+ * Update translation template
13+
14+ [ Michael Terry ]
15+ * Display the current user's real name on the tablet lockscreen. (LP:
16+ #1536714)
17+
18+ -- Michał Sawicz <michal.sawicz@canonical.com> Mon, 08 Feb 2016 09:38:00 +0000
19+
1unity8 (8.11+16.04.20160129-0ubuntu1) xenial; urgency=medium
20unity8 (8.11+16.04.20160129-0ubuntu1) xenial; urgency=medium
2
21
3 [ Albert Astals Cid ]
22 [ Albert Astals Cid ]
plugins/Dash/listviewwithpageheader.cpp+18−9
@@ -219,13 +219,7 @@ void ListViewWithPageHeader::setDelegate(QQmlComponent *delegate)
219 Q_FOREACH(ListItem *item, m_visibleItems)
219 Q_FOREACH(ListItem *item, m_visibleItems)
220 releaseItem(item);
220 releaseItem(item);
221 m_visibleItems.clear();
221 m_visibleItems.clear();
222− m_firstVisibleIndex = -1;
222+ initializeValuesForEmptyList();
223− adjustMinYExtent();
224− setContentY(0);
225− m_clipItem->setY(0);
226− if (m_topSectionItem) {
227− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
228− }
229
223
230 m_delegateModel->setDelegate(delegate);
224 m_delegateModel->setDelegate(delegate);
231
225
@@ -236,6 +230,17 @@ void ListViewWithPageHeader::setDelegate(QQmlComponent *delegate)
236 }
230 }
237}
231}
238
232
233+void ListViewWithPageHeader::initializeValuesForEmptyList()
234+{
235+ m_firstVisibleIndex = -1;
236+ adjustMinYExtent();
237+ setContentY(0);
238+ m_clipItem->setY(0);
239+ if (m_topSectionItem) {
240+ QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
241+ }
242+}
243+
239QQuickItem *ListViewWithPageHeader::header() const
244QQuickItem *ListViewWithPageHeader::header() const
240{
245{
241 return m_headerItem;
246 return m_headerItem;
@@ -835,7 +840,7 @@ bool ListViewWithPageHeader::removeNonVisibleItems(qreal bufferFrom, qreal buffe
835 }
840 }
836 }
841 }
837 if (!foundVisible) {
842 if (!foundVisible) {
838− m_firstVisibleIndex = -1;
843+ initializeValuesForEmptyList();
839 }
844 }
840 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
845 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
841 adjustMinYExtent();
846 adjustMinYExtent();
@@ -1092,7 +1097,11 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1092 }
1097 }
1093
1098
1094 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1099 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1100+ if (m_visibleItems.isEmpty()) {
1101+ initializeValuesForEmptyList();
1102+ } else {
1095− adjustMinYExtent();
1103+ adjustMinYExtent();
1104+ }
1096 }
1105 }
1097
1106
1098 for (int i = 0; i < m_visibleItems.count(); ++i) {
1107 for (int i = 0; i < m_visibleItems.count(); ++i) {
plugins/Dash/listviewwithpageheader.h+1
@@ -168,6 +168,7 @@ private:
168 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
168 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
169 QQuickItem *getSectionItem(const QString &sectionText);
169 QQuickItem *getSectionItem(const QString &sectionText);
170 void updateSectionItem(int modelIndex);
170 void updateSectionItem(int modelIndex);
171+ void initializeValuesForEmptyList();
171
172
172 QQmlDelegateModel *m_delegateModel;
173 QQmlDelegateModel *m_delegateModel;
173
174
plugins/IntegratedLightDM/liblightdm/CMakeLists.txt+3
@@ -13,14 +13,17 @@ add_library(MockLightDM-demo-shared SHARED ${LibLightDM_SOURCES})
13
13
14include_directories(
14include_directories(
15 ${CMAKE_CURRENT_BINARY_DIR}
15 ${CMAKE_CURRENT_BINARY_DIR}
16+ ${GLIB_INCLUDE_DIRS}
16 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
17 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
17)
18)
18
19
19target_link_libraries(integratedLightDM
20target_link_libraries(integratedLightDM
21+ ${GLIB_LIBRARIES}
20 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
22 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
21 -lpam
23 -lpam
22)
24)
23target_link_libraries(MockLightDM-demo-shared
25target_link_libraries(MockLightDM-demo-shared
26+ ${GLIB_LIBRARIES}
24 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
25 -lpam
28 -lpam
26)
29)
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp+23−7
@@ -18,6 +18,7 @@
18
18
19#include "UsersModelPrivate.h"
19#include "UsersModelPrivate.h"
20
20
21+#include <glib.h>
21#include <QDir>
22#include <QDir>
22#include <QSettings>
23#include <QSettings>
23#include <QStringList>
24#include <QStringList>
@@ -28,14 +29,29 @@ namespace QLightDM
28UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
29UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
29 : q_ptr(parent)
30 : q_ptr(parent)
30{
31{
31− QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
32+ QFileInfo demoFile(QDir::homePath() + "/.unity8-greeter-demo");
32− QStringList users = settings.value(QStringLiteral("users"), QStringList() << qgetenv("USER")).toStringList();
33+ QString currentUser = g_get_user_name();
33
34
35+ if (demoFile.exists()) {
36+ QSettings settings(demoFile.filePath(), QSettings::NativeFormat);
37+ QStringList users = settings.value(QStringLiteral("users"), QStringList() << currentUser).toStringList();
38+
34− entries.reserve(users.count());
39+ entries.reserve(users.count());
35− Q_FOREACH(const QString &user, users)
40+ Q_FOREACH(const QString &user, users)
36− {
41+ {
37− QString name = settings.value(user + "/name", user).toString();
42+ QString name = settings.value(user + "/name", user).toString();
38− entries.append({user, name, 0, 0, false, false, 0, 0});
43+ entries.append({user, name, 0, 0, false, false, 0, 0});
44+ }
45+ } else {
46+ // If we were using the actual liblightdm, we could just ask it
47+ // for the user's real name. But we aren't. We *should* ask
48+ // AccountsService for the real name, like liblightdm does internally,
49+ // but this is close enough since AS and passwd are always in sync.
50+ QString realName = QString::fromUtf8(g_get_real_name()); // gets name from passwd entry
51+ if (realName == QStringLiteral("Unknown")) { // glib doesn't translate this string
52+ realName.clear();
53+ }
54+ entries.append({currentUser, realName, 0, 0, false, false, 0, 0});
39 }
55 }
40}
56}
41
57
plugins/Powerd/CMakeLists.txt−2
@@ -1,5 +1,3 @@
1−pkg_search_module(GIO REQUIRED gio-2.0)
2−
3include_directories(
1include_directories(
4 ${GIO_INCLUDE_DIRS}
2 ${GIO_INCLUDE_DIRS}
5)
3)
plugins/Unity/Indicators/CMakeLists.txt−4
@@ -1,9 +1,5 @@
1project(IndicatorsQml)
1project(IndicatorsQml)
2
2
3−pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
4−pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
5−pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
6−
7find_package(Qt5Core REQUIRED)
3find_package(Qt5Core REQUIRED)
8find_package(Qt5Quick REQUIRED)
4find_package(Qt5Quick REQUIRED)
9
5
plugins/Unity/Session/CMakeLists.txt−2
@@ -1,5 +1,3 @@
1−pkg_search_module(GIO REQUIRED gio-2.0)
2−
3include_directories(
1include_directories(
4 ${CMAKE_CURRENT_SOURCE_DIR}
2 ${CMAKE_CURRENT_SOURCE_DIR}
5 ${CMAKE_CURRENT_BINARY_DIR}
3 ${CMAKE_CURRENT_BINARY_DIR}
plugins/Utils/CMakeLists.txt−2
@@ -1,5 +1,3 @@
1−pkg_search_module(GIO REQUIRED gio-2.0)
2−
3include_directories(
1include_directories(
4 ${CMAKE_CURRENT_SOURCE_DIR}
2 ${CMAKE_CURRENT_SOURCE_DIR}
5 ${CMAKE_CURRENT_BINARY_DIR}
3 ${CMAKE_CURRENT_BINARY_DIR}
po/unity8.pot+1−1
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-01-29 11:58+0000\n"
11+"POT-Creation-Date: 2016-02-08 09:50+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
tests/mocks/Utils/CMakeLists.txt−2
@@ -1,5 +1,3 @@
1−pkg_search_module(GIO REQUIRED gio-2.0)
2−
3include_directories(
1include_directories(
4 ${CMAKE_CURRENT_SOURCE_DIR}
2 ${CMAKE_CURRENT_SOURCE_DIR}
5 ${CMAKE_CURRENT_BINARY_DIR}
3 ${CMAKE_CURRENT_BINARY_DIR}
tests/mocks/indicator-service/CMakeLists.txt−1
@@ -1,5 +1,4 @@
1project(mock-indicator-service)
1project(mock-indicator-service)
2−pkg_search_module(GIO REQUIRED gio-2.0)
3
2
4set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
3set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
5
4
tests/plugins/Dash/listviewwithpageheadertest.cpp+23
@@ -1954,6 +1954,29 @@ private Q_SLOTS:
1954 QCOMPARE(lvwph->m_firstVisibleIndex, 0);
1954 QCOMPARE(lvwph->m_firstVisibleIndex, 0);
1955 }
1955 }
1956
1956
1957+ void testBug1540490()
1958+ {
1959+ lvwph->header()->setImplicitHeight(150);
1960+ verifyItem(0, 150., 150., false);
1961+
1962+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 3), Q_ARG(QVariant, 3));
1963+ model->setProperty(0, "size", 400);
1964+ model->setProperty(1, "size", 600);
1965+ model->setProperty(2, "size", 300);
1966+
1967+ scrollToBottom();
1968+ changeContentY(-200);
1969+
1970+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 2));
1971+ model->setProperty(0, "size", 100);
1972+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 1));
1973+ lvwph->header()->setImplicitHeight(50);
1974+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 200));
1975+
1976+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 1);
1977+ verifyItem(0, 50., 200., false);
1978+ }
1979+
1957private:
1980private:
1958 QQuickView *view;
1981 QQuickView *view;
1959 ListViewWithPageHeader *lvwph;
1982 ListViewWithPageHeader *lvwph;
tests/plugins/Dash/listviewwithpageheadertest.qml−1
@@ -85,7 +85,6 @@ Rectangle {
85 pageHeader: Rectangle {
85 pageHeader: Rectangle {
86 color: "transparent"
86 color: "transparent"
87 width: parent.width
87 width: parent.width
88− height: 50
89 implicitHeight: 50
88 implicitHeight: 50
90 Text {
89 Text {
91 anchors.fill: parent
90 anchors.fill: parent
tests/plugins/Unity/Indicators/CMakeLists.txt−4
@@ -1,7 +1,3 @@
1−pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
2−pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
3−pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
4−
5set(INDICATORS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../plugins/Unity/Indicators)
1set(INDICATORS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../plugins/Unity/Indicators)
6set(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
2set(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
7
3
tests/qmltests/Components/tst_LazyImage.qml+27−9
@@ -112,6 +112,11 @@ Rectangle {
112 }
112 }
113 }
113 }
114
114
115+ SignalSpy {
116+ id: signalSpy
117+ signalName: "runningChanged"
118+ }
119+
115 UT.UnityTestCase {
120 UT.UnityTestCase {
116 name: "LazyImage"
121 name: "LazyImage"
117 when: windowShown
122 when: windowShown
@@ -123,6 +128,18 @@ Rectangle {
123 tryCompare(lazy2, "height", units.gu(10));
128 tryCompare(lazy2, "height", units.gu(10));
124 controls3.blank();
129 controls3.blank();
125 tryCompare(lazy3, "width", units.gu(10));
130 tryCompare(lazy3, "width", units.gu(10));
131+
132+ tryCompare(lazy1, "state", "default");
133+ var transition = findChildIn(lazy1, "transitions", "genericTransition");
134+ tryCompare(transition, "running", false);
135+
136+ tryCompare(lazy2, "state", "default");
137+ transition = findChildIn(lazy2, "transitions", "genericTransition");
138+ tryCompare(transition, "running", false);
139+
140+ tryCompare(lazy3, "state", "default");
141+ transition = findChildIn(lazy3, "transitions", "genericTransition");
142+ tryCompare(transition, "running", false);
126 }
143 }
127
144
128 function test_lazyimage_data() {
145 function test_lazyimage_data() {
@@ -131,33 +148,34 @@ Rectangle {
131 {tag: "Unbound Wide", image: lazy1, func: controls1.wide, transition: "readyTransition", width: 160, height: 80, imageWidth: 160, imageHeight: 80, initialWidth: units.gu(10), initialHeight: units.gu(10)},
148 {tag: "Unbound Wide", image: lazy1, func: controls1.wide, transition: "readyTransition", width: 160, height: 80, imageWidth: 160, imageHeight: 80, initialWidth: units.gu(10), initialHeight: units.gu(10)},
132 {tag: "Unbound Square", image: lazy1, func: controls1.square, transition: "readyTransition", width: 160, height: 160, imageWidth: 160, imageHeight: 160, initialWidth: units.gu(10), initialHeight: units.gu(10)},
149 {tag: "Unbound Square", image: lazy1, func: controls1.square, transition: "readyTransition", width: 160, height: 160, imageWidth: 160, imageHeight: 160, initialWidth: units.gu(10), initialHeight: units.gu(10)},
133 {tag: "Unbound Portrait", image: lazy1, func: controls1.portrait, transition: "readyTransition", width: 80, height: 160, imageWidth: 80, imageHeight: 160, initialWidth: units.gu(10), initialHeight: units.gu(10)},
150 {tag: "Unbound Portrait", image: lazy1, func: controls1.portrait, transition: "readyTransition", width: 80, height: 160, imageWidth: 80, imageHeight: 160, initialWidth: units.gu(10), initialHeight: units.gu(10)},
134− {tag: "Unbound Bad path", image: lazy1, func: controls1.badpath, transition: "genericTransition", width: units.gu(10), height: units.gu(10), imageWidth: units.gu(10), imageHeight: units.gu(10), initialWidth: units.gu(10), initialHeight: units.gu(10), placeholder: true, error: true},
151+ {tag: "Unbound Bad path", image: lazy1, func: controls1.badpath, transition: "genericTransition", state: "error", width: units.gu(10), height: units.gu(10), imageWidth: units.gu(10), imageHeight: units.gu(10), initialWidth: units.gu(10), initialHeight: units.gu(10), placeholder: true, error: true},
135 {tag: "Width-bound Blank", image: lazy2, func: controls2.blank, width: units.gu(30), height: units.gu(10), imageWidth: units.gu(30), imageHeight: units.gu(10), initialWidth: units.gu(30), initialHeight: units.gu(10), placeholder: true},
152 {tag: "Width-bound Blank", image: lazy2, func: controls2.blank, width: units.gu(30), height: units.gu(10), imageWidth: units.gu(30), imageHeight: units.gu(10), initialWidth: units.gu(30), initialHeight: units.gu(10), placeholder: true},
136 {tag: "Width-bound Wide", image: lazy2, func: controls2.wide, transition: "readyTransition", width: units.gu(30), height: units.gu(15), imageWidth: units.gu(30), imageHeight: units.gu(15), initialWidth: units.gu(30), initialHeight: units.gu(10)},
153 {tag: "Width-bound Wide", image: lazy2, func: controls2.wide, transition: "readyTransition", width: units.gu(30), height: units.gu(15), imageWidth: units.gu(30), imageHeight: units.gu(15), initialWidth: units.gu(30), initialHeight: units.gu(10)},
137 {tag: "Width-bound Square", image: lazy2, func: controls2.square, transition: "readyTransition", width: units.gu(30), height: units.gu(30), imageWidth: units.gu(30), imageHeight: units.gu(30), initialWidth: units.gu(30), initialHeight: units.gu(10)},
154 {tag: "Width-bound Square", image: lazy2, func: controls2.square, transition: "readyTransition", width: units.gu(30), height: units.gu(30), imageWidth: units.gu(30), imageHeight: units.gu(30), initialWidth: units.gu(30), initialHeight: units.gu(10)},
138 {tag: "Width-bound Portrait", image: lazy2, func: controls2.portrait, transition: "readyTransition", width: units.gu(30), height: units.gu(60), imageWidth: units.gu(30), imageHeight: units.gu(60), initialWidth: units.gu(30), initialHeight: units.gu(10)},
155 {tag: "Width-bound Portrait", image: lazy2, func: controls2.portrait, transition: "readyTransition", width: units.gu(30), height: units.gu(60), imageWidth: units.gu(30), imageHeight: units.gu(60), initialWidth: units.gu(30), initialHeight: units.gu(10)},
139− {tag: "Width-bound Bad path", image: lazy2, func: controls2.badpath, transition: "genericTransition", width: units.gu(30), height: units.gu(10), imageWidth: units.gu(30), imageHeight: units.gu(10), initialWidth: units.gu(30), initialHeight: units.gu(10), placeholder: true, error: true},
156+ {tag: "Width-bound Bad path", image: lazy2, func: controls2.badpath, transition: "genericTransition", state: "error", width: units.gu(30), height: units.gu(10), imageWidth: units.gu(30), imageHeight: units.gu(10), initialWidth: units.gu(30), initialHeight: units.gu(10), placeholder: true, error: true},
140 {tag: "Height-bound Blank", image: lazy3, func: controls3.blank, width: units.gu(10), height: units.gu(12), imageWidth: units.gu(10), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12), placeholder: true},
157 {tag: "Height-bound Blank", image: lazy3, func: controls3.blank, width: units.gu(10), height: units.gu(12), imageWidth: units.gu(10), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12), placeholder: true},
141 {tag: "Height-bound Wide", image: lazy3, func: controls3.wide, transition: "readyTransition", width: units.gu(24), height: units.gu(12), imageWidth: units.gu(24), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
158 {tag: "Height-bound Wide", image: lazy3, func: controls3.wide, transition: "readyTransition", width: units.gu(24), height: units.gu(12), imageWidth: units.gu(24), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
142 {tag: "Height-bound Square", image: lazy3, func: controls3.square, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
159 {tag: "Height-bound Square", image: lazy3, func: controls3.square, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
143 {tag: "Height-bound Portrait", image: lazy3, func: controls3.portrait, transition: "readyTransition", width: units.gu(6), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
160 {tag: "Height-bound Portrait", image: lazy3, func: controls3.portrait, transition: "readyTransition", width: units.gu(6), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12)},
144− {tag: "Height-bound Bad path", image: lazy3, func: controls3.badpath, transition: "genericTransition", width: units.gu(10), height: units.gu(12), imageWidth: units.gu(10), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12), placeholder: true, error: true},
161+ {tag: "Height-bound Bad path", image: lazy3, func: controls3.badpath, transition: "genericTransition", state: "error", width: units.gu(10), height: units.gu(12), imageWidth: units.gu(10), imageHeight: units.gu(12), initialWidth: units.gu(10), initialHeight: units.gu(12), placeholder: true, error: true},
145 {tag: "Fit Blank", image: lazy4, func: controls4.blank, width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true},
162 {tag: "Fit Blank", image: lazy4, func: controls4.blank, width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true},
146 {tag: "Fit Wide", image: lazy4, func: controls4.wide, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(6), initialWidth: units.gu(12), initialHeight: units.gu(12)},
163 {tag: "Fit Wide", image: lazy4, func: controls4.wide, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(6), initialWidth: units.gu(12), initialHeight: units.gu(12)},
147 {tag: "Fit Square", image: lazy4, func: controls4.square, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
164 {tag: "Fit Square", image: lazy4, func: controls4.square, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
148 {tag: "Fit Portrait", image: lazy4, func: controls4.portrait, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
165 {tag: "Fit Portrait", image: lazy4, func: controls4.portrait, transition: "readyTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(6), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12)},
149− {tag: "Fit Bad path", image: lazy4, func: controls4.badpath, transition: "genericTransition", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true, error: true},
166+ {tag: "Fit Bad path", image: lazy4, func: controls4.badpath, transition: "genericTransition", state: "error", width: units.gu(12), height: units.gu(12), imageWidth: units.gu(12), imageHeight: units.gu(12), initialWidth: units.gu(12), initialHeight: units.gu(12), placeholder: true, error: true},
150 ]
167 ]
151 }
168 }
152
169
153 function test_lazyimage(data) {
170 function test_lazyimage(data) {
171+ var transition = findChildIn(data.image, "transitions", data.transition);
172+ signalSpy.target = transition;
173+ signalSpy.clear();
174+
154 data.func();
175 data.func();
155
176
156 if (data.transition) {
177 if (data.transition) {
157− waitForRendering(data.image);
178+ tryCompare(data.image, "state", data.state ? data.state : "ready");
158− // wait for the transition to complete
159− var transition = findChildIn(data.image, "transitions", data.transition);
160− tryCompare(transition, "running", true);
161 tryCompare(transition, "running", false);
179 tryCompare(transition, "running", false);
162 }
180 }
163
181
@@ -186,7 +204,7 @@ Rectangle {
186
204
187 // check the error image
205 // check the error image
188 var error = findChild(data.image, "errorImage");
206 var error = findChild(data.image, "errorImage");
189− compare(error.visible, data.error ? true : false);
207+ tryCompare(error, "visible", data.error ? true : false);
190 }
208 }
191 }
209 }
192}
210}