on xenial help sign in
Merge from trunk
43df35aMichael Terry
CODING+2−11
@@ -23,16 +23,10 @@ $ cd ~/unity8/trunk
23$ ./build --setup
23$ ./build --setup
24
24
25 this will:
25 this will:
26− - add ppa:ubuntu-unity/next
27 - install the required dependencies to build, as well as run on the desktop
26 - install the required dependencies to build, as well as run on the desktop
28 - it should also install unity-scope-home and unity-lens-application which
27 - it should also install unity-scope-home and unity-lens-application which
29 are technically "recommends", not strict dependencies
28 are technically "recommends", not strict dependencies
30
29
31−Note, once the PPA is added, the script runs apt-get update, if you have
32−any failures associated with it, the build script will bail out of the setup
33−and fail to install all the required dependencies.
34−
35−
36build Unity 8
30build Unity 8
37-------------
31-------------
38
32
@@ -75,14 +69,11 @@ Notes
75Running Unity 8 on devices
69Running Unity 8 on devices
76==========================
70==========================
77- Ubuntu Touch builds are currently only available in 13.10 flavour
71- Ubuntu Touch builds are currently only available in 13.10 flavour
78−- supported hardware should match one those listed here
72+- supported hardware should match one of those listed here
79 https://wiki.ubuntu.com/Touch/Devices#Running_fine
73 https://wiki.ubuntu.com/Touch/Devices#Running_fine
80- follow the Ubuntu Touch install instructions for your chosen device
74- follow the Ubuntu Touch install instructions for your chosen device
81 https://wiki.ubuntu.com/Touch/Install
75 https://wiki.ubuntu.com/Touch/Install
82−- make sure your device is connected to a WiFi network
76+- make sure your device is connected to a network
83−- If you haven’t already or if you’ve just freshly flashed your device
84− make sure you run phablet-network-setup which will allow package updates to
85− the device
86- also make sure you have your SSH key in ~/.ssh/id_rsa.pub (or install one
77- also make sure you have your SSH key in ~/.ssh/id_rsa.pub (or install one
87 on the device yourself)
78 on the device yourself)
88
79
Components/CrossFadeImage.qml+1−3
@@ -85,7 +85,7 @@ Item {
85 Connections {
85 Connections {
86 target: __nextImage
86 target: __nextImage
87 onStatusChanged: {
87 onStatusChanged: {
88− if (__nextImage.status == Image.Ready || __nextImage.status == Image.Error) {
88+ if (__nextImage.status == Image.Ready) {
89 swapImages();
89 swapImages();
90 }
90 }
91 }
91 }
@@ -96,7 +96,6 @@ Item {
96 anchors.fill: parent
96 anchors.fill: parent
97 cache: false
97 cache: false
98 asynchronous: true
98 asynchronous: true
99− fillMode: Image.PreserveAspectCrop
100 z: 1
99 z: 1
101 }
100 }
102
101
@@ -105,7 +104,6 @@ Item {
105 anchors.fill: parent
104 anchors.fill: parent
106 cache: false
105 cache: false
107 asynchronous: true
106 asynchronous: true
108− fillMode: Image.PreserveAspectCrop
109 z: 0
107 z: 0
110 }
108 }
111
109
Greeter/GreeterContent.qml+1
@@ -37,6 +37,7 @@ MouseArea {
37
37
38 source: shell.background
38 source: shell.background
39 anchors.fill: parent
39 anchors.fill: parent
40+ crossFade: false
40 fadeInFirst: false
41 fadeInFirst: false
41 }
42 }
42
43
Shell.qml+9−22
@@ -15,7 +15,6 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18−import GSettings 1.0
19import Ubuntu.Application 0.1
18import Ubuntu.Application 0.1
20import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
21import Ubuntu.Gestures 0.1
20import Ubuntu.Gestures 0.1
@@ -43,8 +42,8 @@ FocusScope {
43 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
42 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
44
43
45 property real edgeSize: units.gu(2)
44 property real edgeSize: units.gu(2)
46− property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45+ property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
47− property url background: backgroundSettings.pictureUri
46+ property url background: default_background
48 readonly property real panelHeight: panel.panelHeight
47 readonly property real panelHeight: panel.panelHeight
49
48
50 property bool dashShown: dash.shown
49 property bool dashShown: dash.shown
@@ -130,11 +129,6 @@ FocusScope {
130 }
129 }
131 }
130 }
132
131
133− GSettings {
134− id: backgroundSettings
135− schema.id: "org.gnome.desktop.background"
136− }
137−
138 VolumeControl {
132 VolumeControl {
139 id: volumeControl
133 id: volumeControl
140 }
134 }
@@ -142,12 +136,6 @@ FocusScope {
142 Keys.onVolumeUpPressed: volumeControl.volumeUp()
136 Keys.onVolumeUpPressed: volumeControl.volumeUp()
143 Keys.onVolumeDownPressed: volumeControl.volumeDown()
137 Keys.onVolumeDownPressed: volumeControl.volumeDown()
144
138
145− Keys.onReleased: {
146− if (event.key == Qt.Key_PowerOff) {
147− greeter.show()
148− }
149− }
150−
151 Item {
139 Item {
152 id: underlay
140 id: underlay
153 objectName: "underlay"
141 objectName: "underlay"
@@ -165,16 +153,12 @@ FocusScope {
165 // through the translucent parts of the shell surface.
153 // through the translucent parts of the shell surface.
166 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
154 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
167
155
168− CrossFadeImage {
156+ Image {
169 id: backgroundImage
157 id: backgroundImage
170− objectName: "backgroundImage"
171 source: shell.background
158 source: shell.background
159+ sourceSize.width: parent.width
160+ sourceSize.height: parent.height
172 anchors.fill: parent
161 anchors.fill: parent
173− onStatusChanged: {
174− if (status == Image.Error) {
175− backgroundSettings.pictureUri = shell.defaultBackground
176− }
177− }
178 }
162 }
179
163
180 Rectangle {
164 Rectangle {
@@ -263,6 +247,7 @@ FocusScope {
263 }
247 }
264 }
248 }
265
249
250+
266 Item {
251 Item {
267 id: stagesOuterContainer
252 id: stagesOuterContainer
268
253
@@ -327,6 +312,7 @@ FocusScope {
327 ignoreUnknownSignals: true
312 ignoreUnknownSignals: true
328 }
313 }
329
314
315+
330 Stage {
316 Stage {
331 id: mainStage
317 id: mainStage
332
318
@@ -505,7 +491,7 @@ FocusScope {
505 onSelected: {
491 onSelected: {
506 // Update background
492 // Update background
507 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
493 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
508− shell.background = bgPath ? bgPath : defaultBackground
494+ shell.background = bgPath ? bgPath : default_background
509 // Update edge demo hint
495 // Update edge demo hint
510 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole)
496 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole)
511 shell.showEdgeDemo = true //AccountsService.getUserProperty(user, "demo-edges")
497 shell.showEdgeDemo = true //AccountsService.getUserProperty(user, "demo-edges")
@@ -581,6 +567,7 @@ FocusScope {
581 onPowerStateChange: {
567 onPowerStateChange: {
582 if (state == 0) { // suspend
568 if (state == 0) { // suspend
583 powerConnection.setFocused(false);
569 powerConnection.setFocused(false);
570+ greeter.show();
584 } else if (state == 1) { // active
571 } else if (state == 1) { // active
585 powerConnection.setFocused(true);
572 powerConnection.setFocused(true);
586 }
573 }
build−1
@@ -36,7 +36,6 @@ BUILD_TYPE="debug"
36[ $# -eq 1 ] && BUILD_TYPE="$1"
36[ $# -eq 1 ] && BUILD_TYPE="$1"
37
37
38install_dependencies() {
38install_dependencies() {
39− [ -f /etc/apt/sources.list.d/ubuntu-unity-next-${DISTRIB_CODENAME}.list ] || sudo add-apt-repository ppa:ubuntu-unity/next || exit 1
40 sudo apt-get update || exit 4
39 sudo apt-get update || exit 4
41 echo "Installing Unity 8 dependencies.."
40 echo "Installing Unity 8 dependencies.."
42 sudo apt-get install devscripts \
41 sudo apt-get install devscripts \
debian/changelog+44
@@ -1,3 +1,47 @@
1+unity8 (7.81.3+13.10.20130806-0ubuntu1) saucy; urgency=low
2+
3+ [ Michael Terry ]
4+ * Show the greeter when powerd tells us to, not just whenever we press
5+ the power key. (LP: #1186256)
6+
7+ [ Ubuntu daily release ]
8+ * Automatic snapshot from revision 164
9+
10+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 06 Aug 2013 03:43:01 +0000
11+
12+unity8 (7.81.3+13.10.20130805-0ubuntu1) saucy; urgency=low
13+
14+ [ Michael Terry ]
15+ * Fixes the lockscreen and swiping on the greeter still being possible
16+ even when in tablet mode. (LP: #1204984)
17+ * Watch powerd signals to notice a sleep and unfocus current app when
18+ that happens.
19+
20+ [ Michael Zanetti ]
21+ * make findChild also find invisible childs This considerably
22+ increases the amount of items to be searched up to a level where
23+ testShell didn't finish any more with searching. Hence this commit
24+ also changes findChild to do a breadth-first instead of a depth-
25+ first search.
26+ * Read background from GSettings or fallback to default_background.
27+
28+ [ Andrea Cimitan ]
29+ * Read background from GSettings or fallback to default_background.
30+
31+ [ Albert Astals ]
32+ * Make LVWPH provide a delegateIndex for sectionHeaders This way we
33+ can match the sectionHeader to the model easier in the qml/js side .
34+ * Fix tryCompare call The 4th parameter of tryCompare is timeout not
35+ message .
36+
37+ [ Daniel d'Andrada ]
38+ * Read background from GSettings or fallback to default_background.
39+
40+ [ Ubuntu daily release ]
41+ * Automatic snapshot from revision 162
42+
43+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 05 Aug 2013 02:32:05 +0000
44+
1unity8 (7.81.3+13.10.20130802-0ubuntu1) saucy; urgency=low
45unity8 (7.81.3+13.10.20130802-0ubuntu1) saucy; urgency=low
2
46
3 [ Michael Terry ]
47 [ Michael Terry ]
debian/control+1−3
@@ -58,10 +58,8 @@ Description: Indicators client test application
58
58
59Package: unity8
59Package: unity8
60Architecture: any
60Architecture: any
61−Depends: gsettings-desktop-schemas,
62− qmenumodel-qml,
61+Depends: qmenumodel-qml,
63 qtdeclarative5-dee-plugin,
62 qtdeclarative5-dee-plugin,
64− qtdeclarative5-gsettings1.0,
65 qtdeclarative5-ubuntu-ui-toolkit-plugin,
63 qtdeclarative5-ubuntu-ui-toolkit-plugin,
66 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
64 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
67 qtdeclarative5-xmllistmodel-plugin,
65 qtdeclarative5-xmllistmodel-plugin,
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+2−2
@@ -734,7 +734,7 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
734 releaseItem(listItem);
734 releaseItem(listItem);
735 listItem = nullptr;
735 listItem = nullptr;
736 } else {
736 } else {
737− listItem->setCulled(listItem->y() + listItem->height() + m_clipItem->y() < contentY() || listItem->y() + m_clipItem->y() >= contentY() + height());
737+ listItem->setCulled(listItem->y() + listItem->height() + m_clipItem->y() <= contentY() || listItem->y() + m_clipItem->y() >= contentY() + height());
738 if (m_visibleItems.isEmpty()) {
738 if (m_visibleItems.isEmpty()) {
739 m_visibleItems << listItem;
739 m_visibleItems << listItem;
740 } else {
740 } else {
@@ -1040,7 +1040,7 @@ void ListViewWithPageHeader::layout()
1040 int firstReallyVisibleItem = -1;
1040 int firstReallyVisibleItem = -1;
1041 int modelIndex = m_firstVisibleIndex;
1041 int modelIndex = m_firstVisibleIndex;
1042 Q_FOREACH(ListItem *item, m_visibleItems) {
1042 Q_FOREACH(ListItem *item, m_visibleItems) {
1043− const bool cull = pos + item->height() < visibleFrom || pos >= visibleTo;
1043+ const bool cull = pos + item->height() <= visibleFrom || pos >= visibleTo;
1044 item->setCulled(cull);
1044 item->setCulled(cull);
1045 item->setY(pos);
1045 item->setY(pos);
1046 if (!cull && firstReallyVisibleItem == -1) {
1046 if (!cull && firstReallyVisibleItem == -1) {
run_on_device+2−2
@@ -27,8 +27,8 @@ usage() {
27 echo " -k, --keylock Enable a Keyboard lock screen when running"
27 echo " -k, --keylock Enable a Keyboard lock screen when running"
28 echo ""
28 echo ""
29 echo "IMPORTANT:"
29 echo "IMPORTANT:"
30− echo " * Make sure to have the networking and PPAs setup on the device beforehand (phablet-deploy-networking && phablet-ppa-fetch)."
30+ echo " * Make sure to have networking setup on the device beforehand."
31− echo " * Execute that script from a directory containing a branch the shell code."
31+ echo " * Execute that script from a directory containing unity8 code."
32 exit 1
32 exit 1
33}
33}
34
34
tests/data/unity/backgrounds/blue.pngdeleted

Binary file not shown.

tests/data/unity/backgrounds/red.pngdeleted

Binary file not shown.

tests/mocks/CMakeLists.txt−1
@@ -1,5 +1,4 @@
1add_subdirectory(AccountsService)
1add_subdirectory(AccountsService)
2−add_subdirectory(GSettings)
3add_subdirectory(HudClient)
2add_subdirectory(HudClient)
4add_subdirectory(libusermetrics)
3add_subdirectory(libusermetrics)
5add_subdirectory(LightDM)
4add_subdirectory(LightDM)
tests/mocks/GSettings/CMakeLists.txtdeleted−31
@@ -1,31 +0,0 @@
1−set(CMAKE_AUTOMOC ON)
2−
3−include(FindPkgConfig)
4−find_package(Qt5Core REQUIRED)
5−find_package(Qt5Quick REQUIRED)
6−
7−include_directories(
8− ${CMAKE_CURRENT_BINARY_DIR}
9− ${Qt5Core_INCLUDE_DIRS}
10− ${Qt5Quick_INCLUDE_DIRS}
11−)
12−
13−add_definitions(-DQT_NO_KEYWORDS)
14−
15−set(GSettingsQML_SOURCES
16− fake_gsettings.cpp
17− plugin.cpp
18−)
19−
20−add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
21−target_link_libraries(FakeGSettingsQml
22− ${Qt5Core_LIBRARIES}
23− ${Qt5Quick_LIBRARIES}
24−)
25−
26−qt5_use_modules(FakeGSettingsQml Qml)
27−
28−# copy qmldir file into build directory for shadow builds
29−file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
30− DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
31− )
tests/mocks/GSettings/fake_gsettings.cppdeleted−102
@@ -1,102 +0,0 @@
1−/*
2− * Copyright 2013 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−#include "fake_gsettings.h"
18−
19−#include <QList>
20−
21−GSettingsControllerQml* GSettingsControllerQml::s_controllerInstance = 0;
22−
23−GSettingsControllerQml::GSettingsControllerQml() {
24−}
25−
26−GSettingsControllerQml::~GSettingsControllerQml() {
27− s_controllerInstance = 0;
28−}
29−
30−GSettingsControllerQml* GSettingsControllerQml::instance() {
31− if(!s_controllerInstance) {
32− s_controllerInstance = new GSettingsControllerQml();
33− }
34− return s_controllerInstance;
35−}
36−
37−void GSettingsControllerQml::registerSettingsObject(GSettingsQml *obj) {
38− m_registeredGSettings.append(obj);
39−}
40−
41−void GSettingsControllerQml::unRegisterSettingsObject(GSettingsQml *obj) {
42− m_registeredGSettings.removeOne(obj);
43−}
44−
45−void GSettingsControllerQml::setPictureUri(const QString &str) {
46− Q_FOREACH (GSettingsQml *obj, m_registeredGSettings) {
47− obj->setPictureUri(str);
48− }
49−}
50−
51−GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
52−}
53−
54−QByteArray GSettingsSchemaQml::id() const {
55− return m_id;
56−}
57−
58−void GSettingsSchemaQml::setId(const QByteArray &id) {
59− if (m_id.isEmpty()) {
60− qWarning("GSettings.schema.id may only be set on construction");
61− return;
62− }
63−
64− m_id = id;
65−}
66−
67−QByteArray GSettingsSchemaQml::path() const {
68− return m_path;
69−}
70−
71−void GSettingsSchemaQml::setPath(const QByteArray &path) {
72− if (m_path.isEmpty()) {
73− qWarning("GSettings.schema.path may only be set on construction");
74− return;
75− }
76−
77− m_path = path;
78−}
79−
80−GSettingsQml::GSettingsQml(QObject *parent): QObject(parent) {
81− m_schema = new GSettingsSchemaQml(this);
82− GSettingsControllerQml::instance()->registerSettingsObject(this);
83−}
84−
85−GSettingsQml::~GSettingsQml() {
86− GSettingsControllerQml::instance()->unRegisterSettingsObject(this);
87−}
88−
89−GSettingsSchemaQml * GSettingsQml::schema() const {
90− return m_schema;
91−}
92−
93−QString GSettingsQml::pictureUri() const {
94− return m_pictureUri;
95−}
96−
97−void GSettingsQml::setPictureUri(const QString &str) {
98− if (str != m_pictureUri) {
99− m_pictureUri = str;
100− Q_EMIT pictureUriChanged(m_pictureUri);
101− }
102−}
tests/mocks/GSettings/fake_gsettings.hdeleted−90
@@ -1,90 +0,0 @@
1−/*
2− * Copyright 2013 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−#ifndef FAKE_GSETTINGS_H
18−#define FAKE_GSETTINGS_H
19−
20−#include <QList>
21−#include <QtQml>
22−
23−class GSettingsSchemaQml: public QObject
24−{
25− Q_OBJECT
26−
27− Q_PROPERTY(QByteArray id READ id WRITE setId)
28−
29−public:
30− GSettingsSchemaQml(QObject *parent = NULL);
31−
32− QByteArray id() const;
33− void setId(const QByteArray &id);
34−
35− QByteArray path() const;
36− void setPath(const QByteArray &path);
37−
38−private:
39− QByteArray m_id;
40− QByteArray m_path;
41−};
42−
43−class GSettingsQml: public QObject
44−{
45− Q_OBJECT
46−
47− Q_PROPERTY(GSettingsSchemaQml* schema READ schema NOTIFY schemaChanged)
48− Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged)
49−
50−public:
51− GSettingsQml(QObject *parent = NULL);
52− ~GSettingsQml();
53−
54− GSettingsSchemaQml * schema() const;
55− QString pictureUri() const;
56−
57− void setPictureUri(const QString &str);
58−
59−Q_SIGNALS:
60− void schemaChanged();
61− void pictureUriChanged(const QString&);
62−
63−private:
64− GSettingsSchemaQml* m_schema;
65−
66− QString m_pictureUri;
67−
68− friend class GSettingsSchemaQml;
69−};
70−
71−class GSettingsControllerQml: public QObject
72−{
73− Q_OBJECT
74−
75−public:
76− static GSettingsControllerQml* instance();
77− ~GSettingsControllerQml();
78−
79− void registerSettingsObject(GSettingsQml *obj);
80− void unRegisterSettingsObject(GSettingsQml *obj);
81− Q_INVOKABLE void setPictureUri(const QString &str);
82−
83−private:
84− GSettingsControllerQml();
85−
86− static GSettingsControllerQml* s_controllerInstance;
87− QList<GSettingsQml *> m_registeredGSettings;
88−};
89−
90−#endif // FAKE_GSETTINGS_H
tests/mocks/GSettings/plugin.cppdeleted−33
@@ -1,33 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−#include "plugin.h"
18−#include "fake_gsettings.h"
19−
20−#include <QtQml>
21−
22−static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23−{
24− return GSettingsControllerQml::instance();
25−}
26−
27−void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
28−{
29− qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
30− qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
31− qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
32− "GSettingsSchema can only be used inside of a GSettings component");
33−}
tests/mocks/GSettings/plugin.hdeleted−31
@@ -1,31 +0,0 @@
1−/*
2− * Copyright (C) 2013 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−#ifndef PLUGIN_H
18−#define PLUGIN_H
19−
20−#include <QtQml/QQmlExtensionPlugin>
21−
22−class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
23−{
24− Q_OBJECT
25− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26−
27−public:
28− void registerTypes(const char *uri);
29−};
30−
31−#endif // PLUGIN_H
tests/mocks/GSettings/qmldirdeleted−2
@@ -1,2 +0,0 @@
1−module GSettings
2−plugin FakeGSettingsQml
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp+19
@@ -1390,6 +1390,25 @@ private Q_SLOTS:
1390 lvwph->showHeader();
1390 lvwph->showHeader();
1391 }
1391 }
1392
1392
1393+ void testCullOnBottomEdge()
1394+ {
1395+ changeContentY(200);
1396+
1397+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 4);
1398+ QCOMPARE(lvwph->m_firstVisibleIndex, 0);
1399+ verifyItem(0, -150., 150., true);
1400+ verifyItem(1, 0., 200., false);
1401+ verifyItem(2, 200., 350., false);
1402+ verifyItem(3, 550., 350., true);
1403+ QCOMPARE(lvwph->m_minYExtent, 0.);
1404+ QCOMPARE(lvwph->m_clipItem->y(), 200.);
1405+ QCOMPARE(lvwph->m_clipItem->clip(), false);
1406+ QCOMPARE(lvwph->m_headerItem->y(), 0.);
1407+ QCOMPARE(lvwph->m_headerItem->height(), 50.);
1408+ QCOMPARE(lvwph->contentY(), 200.);
1409+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1410+ }
1411+
1393private:
1412private:
1394 QQuickView *view;
1413 QQuickView *view;
1395 ListViewWithPageHeader *lvwph;
1414 ListViewWithPageHeader *lvwph;
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+20
@@ -1691,6 +1691,26 @@ private Q_SLOTS:
1691 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1691 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1692 }
1692 }
1693
1693
1694+ void testCullOnBottomEdge()
1695+ {
1696+ changeContentY(240);
1697+
1698+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 4);
1699+ QCOMPARE(lvwph->m_firstVisibleIndex, 0);
1700+ verifyItem(0, -190., 190., true, "Agressive", true);
1701+ verifyItem(1, 0., 240., false, "Regular", false);
1702+ verifyItem(2, 240., 390., false, "Mild", false);
1703+ verifyItem(3, 630., 390., true, "Bold", true);
1704+ QCOMPARE(lvwph->m_minYExtent, 0.);
1705+ QCOMPARE(lvwph->m_clipItem->y(), 240.);
1706+ QCOMPARE(lvwph->m_clipItem->clip(), false);
1707+ QCOMPARE(lvwph->m_headerItem->y(), 0.);
1708+ QCOMPARE(lvwph->m_headerItem->height(), 50.);
1709+ QCOMPARE(lvwph->contentY(), 240.);
1710+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1711+ QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1712+ }
1713+
1694private:
1714private:
1695 QQuickView *view;
1715 QQuickView *view;
1696 ListViewWithPageHeader *lvwph;
1716 ListViewWithPageHeader *lvwph;
tests/qmltests/CMakeLists.txt+1−1
@@ -26,7 +26,7 @@ set(qmltest_DEFAULT_TARGETS qmluitests)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
27set(qmltest_DEFAULT_PROPERTIES "")
27set(qmltest_DEFAULT_PROPERTIES "")
28
28
29−add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks
29+add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
31add_qml_test(Components DemoOverlay)
31add_qml_test(Components DemoOverlay)
32add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
32add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
tests/qmltests/tst_Shell.qml−14
@@ -19,7 +19,6 @@
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21import QtTest 1.0
21import QtTest 1.0
22−import GSettings 1.0
23import Ubuntu.Application 0.1
22import Ubuntu.Application 0.1
24import Unity.Test 0.1 as UT
23import Unity.Test 0.1 as UT
25
24
@@ -278,18 +277,5 @@ Item {
278 }
277 }
279 } while (!isStill);
278 } while (!isStill);
280 }
279 }
281−
282− function test_wallpaper_data() {
283− return [
284− {tag: "red", url: "tests/data/unity/backgrounds/red.png"},
285− {tag: "blue", url: "tests/data/unity/backgrounds/blue.png"}
286− ]
287− }
288−
289− function test_wallpaper(data) {
290− var backgroundImage = findChild(shell, "backgroundImage")
291− GSettingsController.setPictureUri(data.url)
292− tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
293− }
294 }
280 }
295}
281}