Merge lp:~bzoltan/ubuntu-ui-toolkit/Landing-2017-03-06 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zoltan Balogh
Approved revision: no longer in the source branch.
Merged at revision: 1389
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/Landing-2017-03-06
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 1395 lines (+474/-143)
41 files modified
components.api (+1/-0)
debian/changelog (+40/-0)
examples/ubuntu-ui-toolkit-gallery/Toggles.qml (+43/-0)
src/UbuntuToolkit/menu.cpp (+2/-1)
src/UbuntuToolkit/menubar.cpp (+2/-1)
src/UbuntuToolkit/menugroup.cpp (+2/-1)
src/UbuntuToolkit/privates/uccontenthub.cpp (+45/-45)
src/UbuntuToolkit/privates/uccontenthub_p.h (+17/-14)
src/UbuntuToolkit/sortfiltermodel.cpp (+5/-2)
src/UbuntuToolkit/ucapplication.cpp (+0/-3)
src/UbuntuToolkit/ucmainwindow.cpp (+9/-7)
src/UbuntuToolkit/ucmainwindow_p.h (+2/-0)
src/UbuntuToolkit/ucqquickimageextension.cpp (+53/-2)
src/UbuntuToolkit/ucqquickimageextension_p.h (+1/-0)
src/UbuntuToolkit/ucslotslayout.cpp (+1/-0)
src/UbuntuToolkit/ucstylehints.cpp (+1/-0)
src/imports/Components/1.3/ListItemPopover.qml (+2/-1)
src/imports/Components/1.3/OptionSelector.qml (+6/-0)
src/imports/Components/1.3/TextField.qml (+6/-1)
src/imports/Components/1.3/UbuntuListView.qml (+1/-0)
src/imports/Components/ListItems/1.3/LabelVisual.qml (+2/-1)
src/imports/Components/ListItems/1.3/ThinDivider.qml (+2/-2)
src/imports/Components/Popups/1.3/popupUtils.js (+1/-1)
src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml (+17/-3)
src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+2/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.ListItemTestCase.qml (+9/-2)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py (+13/-1)
tests/unit/components/tst_sortfiltermodel.qml (+14/-3)
tests/unit/contenthub/tst_contenthub.cpp (+17/-22)
tests/unit/mainwindow/VisualRoot.qml (+0/-1)
tests/unit/mainwindow/tst_mainwindow.cpp (+33/-10)
tests/unit/qquick_image_extension/borderInName.sci (+0/-7)
tests/unit/qquick_image_extension/data/borderInName.sci (+7/-0)
tests/unit/qquick_image_extension/data/hundred_faces.qml (+13/-0)
tests/unit/qquick_image_extension/data/test@18.sci (+7/-0)
tests/unit/qquick_image_extension/qquick_image_extension.pro (+1/-1)
tests/unit/qquick_image_extension/test@18.sci (+0/-7)
tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp (+38/-3)
tests/unit/visual/tst_optionselector.13.qml (+9/-0)
tests/unit/visual/tst_toggles.13.qml (+48/-0)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/Landing-2017-03-06
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
Review via email: mp+319093@code.launchpad.net

Commit message

landing

Description of the change

landing

To post a comment you must log in.
Revision history for this message
Zoltan Balogh (bzoltan) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2017-01-26 11:59:45 +0000
+++ components.api 2017-03-06 16:02:52 +0000
@@ -731,6 +731,7 @@
731Ubuntu.Components.OptionSelector 1.3: Empty731Ubuntu.Components.OptionSelector 1.3: Empty
732 property bool colourImage732 property bool colourImage
733 property double containerHeight733 property double containerHeight
734 readonly property int count
734 property bool currentlyExpanded735 property bool currentlyExpanded
735 property Component delegate736 property Component delegate
736 property bool expanded737 property bool expanded
737738
=== modified file 'debian/changelog'
--- debian/changelog 2017-01-30 11:30:04 +0000
+++ debian/changelog 2017-03-06 16:02:52 +0000
@@ -1,3 +1,43 @@
1ubuntu-ui-toolkit (1.3.2184+17.04) UNRELEASED; urgency=medium
2
3 [ Adnane Belmadiaf ]
4 * Add support for CheckBox label when set
5 * Add more tests for checkbox. Fixes LP: #1333228, LP: #1442851.
6 * Make sure we resets partial text input from the input method.
7 Fixes LP: #1630872.
8 * Fix ListItem title/subtitle alignment & elide in RTL mode.
9 Fixes LP: #1665944.
10 * Fix PageHeader title alignment & elide in RTL mode. Fixes LP: #1665942.
11 * Fix UbuntuListView docs. Fixes LP: #1486940.
12 * Add count prop to OptionSelector. Fixes LP: #1341559.
13 * Replace the hardcoded color with a theme color. Fixes LP: #1664758.
14 * Fix the import statement for Menu, MenuBar and MenuGroup.
15 Fixes LP: #1660604.
16
17 [ Albert Astals Cid ]
18 * Fix memory leak in UCStyleHints
19 * ThinDivider: Anchors can't be null, set to undefined
20 * No need to call UCUnits::resolveResource to learn we just need to load it
21 normally because the fact that we already loaded it normally means we need
22 to load it normally. Fixes LP: #1558663.
23 * Fix conditional jump or move depends on uninitialised value(s)
24
25 [ Christian Dywan ]
26 * Initialize UCApplication with no side effects. Fixes LP: #1662868.
27 * Unit test case insensitive FilterBehavior.pattern. Fixes LP: #1663924.
28 * ListItemPopover delegate should (in)visible as per action Bug 1662220:
29 [ListItem] Popupmenu shows traces of disabled actions
30
31 [ Olivier Tilloy ]
32 * Check that window is not null before accessing its activeFocusItem property.
33 Fixes LP: #1664620.
34
35 [ Lukáš Tinkl ]
36 * Unbreak the startup race between unity8/qtmir and UITK trying talk to
37 content-hub. Fixes LP: #1663106.
38
39 -- Zoltán Balogh <zoltan@bakter.hu> Mon, 06 Mar 2017 17:51:04 +0200
40
1ubuntu-ui-toolkit (1.3.2166+17.04.20170130) zesty; urgency=medium41ubuntu-ui-toolkit (1.3.2166+17.04.20170130) zesty; urgency=medium
242
3 [ Andrea Bernabei ]43 [ Andrea Bernabei ]
444
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Toggles.qml'
--- examples/ubuntu-ui-toolkit-gallery/Toggles.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Toggles.qml 2017-03-06 16:02:52 +0000
@@ -55,6 +55,49 @@
55 checked: true55 checked: true
56 }56 }
57 }57 }
58
59 TemplateRow {
60 title: i18n.tr("Checkbox with label")
61
62 CheckBox {
63 objectName: "checkbox_checked_lbl"
64 checked: true
65 text: "This a checkbox label"
66 }
67 }
68
69 TemplateRow {
70 title: i18n.tr("Disabled checkbox with label")
71
72 CheckBox {
73 objectName: "checkbox_disabled_checked_lbl"
74 checked: true
75 enabled: false
76 text: "This a checkbox label"
77 }
78 }
79
80 TemplateRow {
81 title: i18n.tr("Disabled checkbox with label")
82
83 CheckBox {
84 objectName: "checkbox_disabled_checked_lbl"
85 checked: false
86 enabled: false
87 text: "This a checkbox label"
88 }
89 }
90
91 TemplateRow {
92 title: i18n.tr("Checkbox with multiline label")
93
94 CheckBox {
95 objectName: "checkbox_checked_lbl"
96 checked: true
97 text: "This is a checkbox with a built-in label spanning several lines that won't be ellipsized but increase in height instead"
98 width: parent.width
99 }
100 }
58 }101 }
59102
60103
61104
=== modified file 'src/UbuntuToolkit/menu.cpp'
--- src/UbuntuToolkit/menu.cpp 2016-09-09 18:16:57 +0000
+++ src/UbuntuToolkit/menu.cpp 2017-03-06 16:02:52 +0000
@@ -303,7 +303,7 @@
303303
304/*!304/*!
305 * \qmltype Menu305 * \qmltype Menu
306 * \inqmlmodule Ubuntu.Components306 * \inqmlmodule Ubuntu.Components.Labs
307 * \ingroup ubuntu307 * \ingroup ubuntu
308 * \brief Menu defines a context menu or submenu structure of a MenuBar308 * \brief Menu defines a context menu or submenu structure of a MenuBar
309 *309 *
@@ -311,6 +311,7 @@
311 * \qml311 * \qml
312 * import QtQuick 2.4312 * import QtQuick 2.4
313 * import Ubuntu.Components 1.3313 * import Ubuntu.Components 1.3
314 * import Ubuntu.Components.Labs 1.0
314 * Menu {315 * Menu {
315 * text: "&File"316 * text: "&File"
316 *317 *
317318
=== modified file 'src/UbuntuToolkit/menubar.cpp'
--- src/UbuntuToolkit/menubar.cpp 2016-09-09 17:49:07 +0000
+++ src/UbuntuToolkit/menubar.cpp 2017-03-06 16:02:52 +0000
@@ -104,7 +104,7 @@
104104
105/*!105/*!
106 * \qmltype MenuBar106 * \qmltype MenuBar
107 * \inqmlmodule Ubuntu.Components 1.3107 * \inqmlmodule Ubuntu.Components.Labs
108 * \ingroup ubuntu108 * \ingroup ubuntu
109 * \brief MenuBar defines an application menu bar structure109 * \brief MenuBar defines an application menu bar structure
110 *110 *
@@ -112,6 +112,7 @@
112 * \qml112 * \qml
113 * import QtQuick 2.4113 * import QtQuick 2.4
114 * import Ubuntu.Components 1.3114 * import Ubuntu.Components 1.3
115 * import Ubuntu.Components.Labs 1.0
115 * MainView {116 * MainView {
116 * MenuBar {117 * MenuBar {
117 * Menu {118 * Menu {
118119
=== modified file 'src/UbuntuToolkit/menugroup.cpp'
--- src/UbuntuToolkit/menugroup.cpp 2016-09-09 17:49:07 +0000
+++ src/UbuntuToolkit/menugroup.cpp 2017-03-06 16:02:52 +0000
@@ -23,7 +23,7 @@
2323
24/*!24/*!
25 * \qmltype MenuGroup25 * \qmltype MenuGroup
26 * \inqmlmodule Ubuntu.Components26 * \inqmlmodule Ubuntu.Components.Labs
27 * \ingroup ubuntu27 * \ingroup ubuntu
28 * \brief Logical list of items for a menu.28 * \brief Logical list of items for a menu.
29 *29 *
@@ -31,6 +31,7 @@
31 * \qml31 * \qml
32 * import QtQuick 2.432 * import QtQuick 2.4
33 * import Ubuntu.Components 1.333 * import Ubuntu.Components 1.3
34 * import Ubuntu.Components.Labs 1.0
34 * Menu {35 * Menu {
35 * text: "Edit"36 * text: "Edit"
36 *37 *
3738
=== modified file 'src/UbuntuToolkit/privates/uccontenthub.cpp'
--- src/UbuntuToolkit/privates/uccontenthub.cpp 2017-01-26 14:29:30 +0000
+++ src/UbuntuToolkit/privates/uccontenthub.cpp 2017-03-06 16:02:52 +0000
@@ -21,8 +21,10 @@
21#include <QtCore/QLoggingCategory>21#include <QtCore/QLoggingCategory>
22#include <QtCore/QMimeData>22#include <QtCore/QMimeData>
23#include <QtDBus/QDBusConnection>23#include <QtDBus/QDBusConnection>
24#include <QtDBus/QDBusConnectionInterface>
24#include <QtDBus/QDBusInterface>25#include <QtDBus/QDBusInterface>
25#include <QtDBus/QDBusReply>26#include <QtDBus/QDBusReply>
27#include <QtDBus/QDBusServiceWatcher>
26#include <QtQuick/QQuickItem>28#include <QtQuick/QQuickItem>
2729
28Q_LOGGING_CATEGORY(ucContentHub, "ubuntu.components.UCContentHub", QtMsgType::QtWarningMsg)30Q_LOGGING_CATEGORY(ucContentHub, "ubuntu.components.UCContentHub", QtMsgType::QtWarningMsg)
@@ -40,11 +42,17 @@
40UT_NAMESPACE_BEGIN42UT_NAMESPACE_BEGIN
4143
42UCContentHub::UCContentHub(QObject *parent)44UCContentHub::UCContentHub(QObject *parent)
43 : QObject(parent),45 : QObject(parent)
44 m_dbusIface(0),46{
45 m_contentHubIface(0),47 if (QDBusConnection::sessionBus().interface()->isServiceRegistered(contentHubService)) { // content hub already running
46 m_canPaste(false),48 init();
47 m_targetItem(0)49 } else {
50 m_watcher = new QDBusServiceWatcher(contentHubService, QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForRegistration, this);
51 connect(m_watcher, &QDBusServiceWatcher::serviceRegistered, this, &UCContentHub::init);
52 }
53}
54
55void UCContentHub::init()
48{56{
49 m_dbusIface = new QDBusInterface(dbusService,57 m_dbusIface = new QDBusInterface(dbusService,
50 dbusObjectPath,58 dbusObjectPath,
@@ -76,24 +84,13 @@
76 SLOT(onPasteboardChanged())84 SLOT(onPasteboardChanged())
77 );85 );
7886
79 m_canPaste = checkPasteFormats();87 onPasteboardChanged();
80 }
81}
82
83UCContentHub::~UCContentHub()
84{
85 if (m_dbusIface) {
86 delete m_dbusIface;
87 }
88
89 if (m_contentHubIface) {
90 delete m_contentHubIface;
91 }88 }
92}89}
9390
94void UCContentHub::requestPaste(QQuickItem *targetItem)91void UCContentHub::requestPaste(QQuickItem *targetItem)
95{92{
96 if (!m_contentHubIface->isValid()) {93 if (!m_contentHubIface || !m_contentHubIface->isValid()) {
97 CONTENT_HUB_TRACE("Invalid Content Hub DBusInterface");94 CONTENT_HUB_TRACE("Invalid Content Hub DBusInterface");
98 return;95 return;
99 }96 }
@@ -106,12 +103,12 @@
106 m_contentHubIface->call(QStringLiteral("RequestPasteByAppId"), appProfile);103 m_contentHubIface->call(QStringLiteral("RequestPasteByAppId"), appProfile);
107}104}
108105
109bool UCContentHub::canPaste()106bool UCContentHub::canPaste() const
110{107{
111 return m_canPaste;108 return m_canPaste;
112}109}
113110
114void UCContentHub::onPasteSelected(QString appId, QByteArray mimedata, bool pasteAsRichText)111void UCContentHub::onPasteSelected(const QString &appId, const QByteArray &mimedata, bool pasteAsRichText)
115{112{
116 if (getAppProfile() != appId) {113 if (getAppProfile() != appId) {
117 return;114 return;
@@ -138,15 +135,39 @@
138135
139void UCContentHub::onPasteboardChanged()136void UCContentHub::onPasteboardChanged()
140{137{
141 if (checkPasteFormats() != m_canPaste) {138 if (!m_contentHubIface || !m_contentHubIface->isValid()) {
142 m_canPaste = !m_canPaste;139 CONTENT_HUB_TRACE("Invalid Content Hub DBusInterface");
140 return;
141 }
142
143 QDBusPendingCall pcall = m_contentHubIface->asyncCall(QStringLiteral("PasteFormats"));
144 QDBusPendingCallWatcher * watcher = new QDBusPendingCallWatcher(pcall, this);
145 connect(watcher, &QDBusPendingCallWatcher::finished, [this](QDBusPendingCallWatcher * call) {
146 QDBusPendingReply<QStringList> reply = *call;
147 call->deleteLater();
148 if (reply.isValid()) {
149 // TODO: ContentHub clipboard keeps a list of all available paste formats.
150 // Probably apps could make use of this information to check if a specific
151 // data type is available, instead of only checking if list is empty or not.
152 // (LP: #1657111)
153 setCanPaste(!reply.value().isEmpty());
154 } else {
155 CONTENT_HUB_TRACE("Invalid return from DBus call PasteFormats");
156 }
157 });
158}
159
160void UCContentHub::setCanPaste(bool value)
161{
162 if (value != m_canPaste) {
163 m_canPaste = value;
143 Q_EMIT canPasteChanged();164 Q_EMIT canPasteChanged();
144 }165 }
145}166}
146167
147QString UCContentHub::getAppProfile()168QString UCContentHub::getAppProfile() const
148{169{
149 if (!m_dbusIface->isValid()) {170 if (!m_dbusIface || !m_dbusIface->isValid()) {
150 CONTENT_HUB_TRACE("Invalid DBus DBusInterface");171 CONTENT_HUB_TRACE("Invalid DBus DBusInterface");
151 return QString();172 return QString();
152 }173 }
@@ -194,25 +215,4 @@
194 return mimeData;215 return mimeData;
195}216}
196217
197bool UCContentHub::checkPasteFormats()
198{
199 if (!m_contentHubIface->isValid()) {
200 CONTENT_HUB_TRACE("Invalid Content Hub DBusInterface");
201 return false;
202 }
203
204 QDBusReply<QStringList> reply = m_contentHubIface->call(QStringLiteral("PasteFormats"));
205 if (reply.isValid()) {
206 // TODO: ContentHub clipboard keeps a list of all available paste formats.
207 // Probably apps could make use of this information to check if a specific
208 // data type is available, instead of only checking if list is empty or not.
209 // (LP: #1657111)
210 return !reply.value().isEmpty();
211 } else {
212 CONTENT_HUB_TRACE("Invalid return from DBus call PasteFormats");
213 }
214
215 return false;
216}
217
218UT_NAMESPACE_END218UT_NAMESPACE_END
219219
=== modified file 'src/UbuntuToolkit/privates/uccontenthub_p.h'
--- src/UbuntuToolkit/privates/uccontenthub_p.h 2017-01-17 19:30:01 +0000
+++ src/UbuntuToolkit/privates/uccontenthub_p.h 2017-03-06 16:02:52 +0000
@@ -25,6 +25,7 @@
2525
26class QMimeData;26class QMimeData;
27class QDBusInterface;27class QDBusInterface;
28class QDBusServiceWatcher;
28class QQuickItem;29class QQuickItem;
2930
30UT_NAMESPACE_BEGIN31UT_NAMESPACE_BEGIN
@@ -32,35 +33,37 @@
32class UBUNTUTOOLKIT_EXPORT UCContentHub : public QObject33class UBUNTUTOOLKIT_EXPORT UCContentHub : public QObject
33{34{
34 Q_OBJECT35 Q_OBJECT
3536 friend class tst_UCContentHub;
36 Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)37 Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)
3738
38public:39public:
39 UCContentHub(QObject* parent = 0);40 UCContentHub(QObject* parent = nullptr);
40 ~UCContentHub();41 ~UCContentHub() = default;
4142
42 Q_INVOKABLE void requestPaste(QQuickItem *targetItem);43 Q_INVOKABLE void requestPaste(QQuickItem *targetItem);
4344
44 bool canPaste();45 bool canPaste() const;
45 QString getAppProfile();46 QString getAppProfile() const;
46 QMimeData* deserializeMimeData(const QByteArray &serializedMimeData);47 QMimeData* deserializeMimeData(const QByteArray &serializedMimeData);
4748
48Q_SIGNALS:49Q_SIGNALS:
49 void pasteSelected(QQuickItem *targetItem, const QString &data);50 void pasteSelected(QQuickItem *targetItem, const QString &data);
50 void canPasteChanged();51 void canPasteChanged();
5152
52public Q_SLOTS:53private Q_SLOTS:
53 void onPasteSelected(QString appId, QByteArray mimedata, bool pasteAsRichText);54 void init();
55 void onPasteSelected(const QString &appId, const QByteArray &mimedata, bool pasteAsRichText);
54 void onPasteboardChanged();56 void onPasteboardChanged();
5557
56private:58private:
57 bool checkPasteFormats();59 void setCanPaste(bool value);
5860 QDBusInterface *m_dbusIface{nullptr};
59 QDBusInterface *m_dbusIface;61 QDBusInterface *m_contentHubIface{nullptr};
60 QDBusInterface *m_contentHubIface;62
6163 bool m_canPaste{false};
62 bool m_canPaste;64 QQuickItem *m_targetItem{nullptr};
63 QQuickItem *m_targetItem;65
66 QDBusServiceWatcher * m_watcher{nullptr};
64};67};
6568
66UT_NAMESPACE_END69UT_NAMESPACE_END
6770
=== modified file 'src/UbuntuToolkit/sortfiltermodel.cpp'
--- src/UbuntuToolkit/sortfiltermodel.cpp 2016-09-12 09:03:50 +0000
+++ src/UbuntuToolkit/sortfiltermodel.cpp 2017-03-06 16:02:52 +0000
@@ -52,7 +52,8 @@
52 * }52 * }
53 * ListElement {53 * ListElement {
54 * title: "Elephants Dream"54 * title: "Elephants Dream"
55 * producer: "Blender"55 * // lowercase b
56 * producer: "blender"
56 * }57 * }
57 * ListElement {58 * ListElement {
58 * title: "Big Buck Bunny"59 * title: "Big Buck Bunny"
@@ -69,7 +70,8 @@
69 * sortCaseSensitivity: Qt.CaseInsensitive70 * sortCaseSensitivity: Qt.CaseInsensitive
70 *71 *
71 * filter.property: "producer"72 * filter.property: "producer"
72 * filter.pattern: /blender/73 * // case insensitive matches
74 * filter.pattern: /blender/i
73 * }75 * }
74 *76 *
75 * ListView {77 * ListView {
@@ -154,6 +156,7 @@
154 * \li /possible/ matches anywhere in a word, so both "impossible" and "possible".156 * \li /possible/ matches anywhere in a word, so both "impossible" and "possible".
155 * \li /^sign/ matches "sign". But not "assignment" because ^ means start.157 * \li /^sign/ matches "sign". But not "assignment" because ^ means start.
156 * \li /vest$/ matches "safety vest" and "vest" but not "vested".158 * \li /vest$/ matches "safety vest" and "vest" but not "vested".
159 * \li /bar/i matches "bar", "Bar" or "BAR" regardless of case.
157 * \endlist160 * \endlist
158 *161 *
159 * For more advanced uses it's recommended to read up on Javascript regular expressions.162 * For more advanced uses it's recommended to read up on Javascript regular expressions.
160163
=== modified file 'src/UbuntuToolkit/ucapplication.cpp'
--- src/UbuntuToolkit/ucapplication.cpp 2017-01-12 15:20:31 +0000
+++ src/UbuntuToolkit/ucapplication.cpp 2017-03-06 16:02:52 +0000
@@ -39,8 +39,6 @@
39UCApplication::UCApplication(QObject* parent) : QObject(parent), m_context(0)39UCApplication::UCApplication(QObject* parent) : QObject(parent), m_context(0)
40 , m_inputMethod(QGuiApplication::inputMethod())40 , m_inputMethod(QGuiApplication::inputMethod())
41{41{
42 // Unset organization by default to skip an extra folder component
43 QCoreApplication::setOrganizationName(QStringLiteral(""));
44 // Make sure we receive application name changes from C++ modules42 // Make sure we receive application name changes from C++ modules
45 connect(QCoreApplication::instance(), &QCoreApplication::applicationNameChanged,43 connect(QCoreApplication::instance(), &QCoreApplication::applicationNameChanged,
46 this, &UCApplication::applicationNameChanged);44 this, &UCApplication::applicationNameChanged);
@@ -70,7 +68,6 @@
70 to how Unity uses it to distinguish running applications.68 to how Unity uses it to distinguish running applications.
71 */69 */
72 QCoreApplication::setApplicationName(applicationName);70 QCoreApplication::setApplicationName(applicationName);
73 QCoreApplication::setOrganizationName(QCoreApplication::organizationName());
74 /*71 /*
75 Ensure that LocalStorage and WebKit use the same location72 Ensure that LocalStorage and WebKit use the same location
76 Docs are ambiguous: in practise applicationName is ignored by default73 Docs are ambiguous: in practise applicationName is ignored by default
7774
=== modified file 'src/UbuntuToolkit/ucmainwindow.cpp'
--- src/UbuntuToolkit/ucmainwindow.cpp 2017-01-18 17:23:48 +0000
+++ src/UbuntuToolkit/ucmainwindow.cpp 2017-03-06 16:02:52 +0000
@@ -163,11 +163,7 @@
163 return;163 return;
164164
165 d->m_applicationName = applicationName;165 d->m_applicationName = applicationName;
166166 updateApplication(applicationName, d->m_organizationName);
167 if (applicationName != QStringLiteral("")) {
168 UbuntuI18n::instance()->setDomain(applicationName);
169 UCApplication::instance()->setApplicationName(applicationName);
170 }
171 Q_EMIT applicationNameChanged(applicationName);167 Q_EMIT applicationNameChanged(applicationName);
172}168}
173169
@@ -192,11 +188,17 @@
192 return;188 return;
193189
194 d->m_organizationName = organizationName;190 d->m_organizationName = organizationName;
191 updateApplication(d->m_applicationName, organizationName);
192 Q_EMIT organizationNameChanged(organizationName);
193}
195194
196 if (organizationName != QStringLiteral("")) {195void UCMainWindow::updateApplication(QString applicationName, QString organizationName)
196{
197 if (applicationName != QStringLiteral("")) {
198 UbuntuI18n::instance()->setDomain(applicationName);
197 QCoreApplication::setOrganizationName(organizationName);199 QCoreApplication::setOrganizationName(organizationName);
200 UCApplication::instance()->setApplicationName(applicationName);
198 }201 }
199 Q_EMIT organizationNameChanged(organizationName);
200}202}
201203
202/*!204/*!
203205
=== modified file 'src/UbuntuToolkit/ucmainwindow_p.h'
--- src/UbuntuToolkit/ucmainwindow_p.h 2017-01-16 16:52:57 +0000
+++ src/UbuntuToolkit/ucmainwindow_p.h 2017-03-06 16:02:52 +0000
@@ -76,6 +76,8 @@
76#endif76#endif
7777
78private:78private:
79 void updateApplication(QString applicationName, QString organizationName);
80
79 Q_DECLARE_PRIVATE(UCMainWindow)81 Q_DECLARE_PRIVATE(UCMainWindow)
80};82};
8183
8284
=== modified file 'src/UbuntuToolkit/ucqquickimageextension.cpp'
--- src/UbuntuToolkit/ucqquickimageextension.cpp 2016-09-12 09:03:50 +0000
+++ src/UbuntuToolkit/ucqquickimageextension.cpp 2017-03-06 16:02:52 +0000
@@ -22,7 +22,13 @@
22#include <QtCore/QFile>22#include <QtCore/QFile>
23#include <QtCore/QFileInfo>23#include <QtCore/QFileInfo>
24#include <QtGui/QGuiApplication>24#include <QtGui/QGuiApplication>
25#include <QtQuick/private/qquickitem_p.h>
25#include <QtQuick/private/qquickimagebase_p.h>26#include <QtQuick/private/qquickimagebase_p.h>
27#include <QtQuick/private/qquickpixmapcache_p.h>
28
29#define foreach Q_FOREACH
30#include <QtQml/private/qqmlengine_p.h>
31#undef foreach
2632
27#include "ucunits_p.h"33#include "ucunits_p.h"
2834
@@ -61,11 +67,35 @@
61 return m_source;67 return m_source;
62}68}
6369
70
64void UCQQuickImageExtension::setSource(const QUrl& url)71void UCQQuickImageExtension::setSource(const QUrl& url)
65{72{
66 if (url != m_source) {73 if (url != m_source) {
67 m_source = url;74 m_source = url;
68 reloadSource();75 // We need to wait until the component is complete
76 // so that m_image->sourceSize() is actually valid
77 if (QQuickItemPrivate::get(m_image)->componentComplete) {
78 reloadSource();
79 } else {
80 // This is a bit convoluted but i couldn't find a better way to get notified of when
81 // the image actually finishes constructing.
82 // Since what we're interested in reloadSource() is the image having the sourceSize set,
83 // what we do is connect to the sourceSizeChanged signal.
84 // The problem is that this signal isn't fired if the Image {} doesn't have sourceSize set
85 // so we tell the engine to fire the sourceSizeChanged signal when the image finishes constructing
86 // This way if the Image {} has a sourceSize set the lambda gets called because of it
87 // and if there's no sourceSize set the lambda gets called because we registered the finalize callback
88
89 connect(m_image, &QQuickImageBase::sourceSizeChanged,
90 this,
91 [&] {
92 QObject::disconnect(m_image, &QQuickImageBase::sourceSizeChanged, this, nullptr);
93 reloadSource();
94 });
95
96 QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(m_image));
97 engPriv->registerFinalizeCallback(m_image, m_image->metaObject()->indexOfSignal("sourceSizeChanged()"));
98 }
69 }99 }
70}100}
71101
@@ -80,6 +110,25 @@
80 return;110 return;
81 }111 }
82112
113 // If the url we're trying to load is already in the cache and
114 // the devicePixelRatio is 1, we save calling UCUnits::resolveResource
115 // and just set that image directly.
116 // UCUnits::resolveResource is not cheap (does a stat on disk)
117 if (qFuzzyCompare(qGuiApp->devicePixelRatio(), (qreal)1.0)) {
118 QSize ss = m_image->sourceSize();
119 if (ss.isNull() && m_image->image().isNull()) {
120 // For some reason QQuickImage returns 0x0 as sourceSize
121 // when the sourceSize is not set (and the image has not yet been loaded)
122 // so set it back to -1x-1
123 ss = QSize(-1, -1);
124 }
125
126 if (QQuickPixmap::isCached(m_source, ss)) {
127 m_image->setSource(m_source);
128 return;
129 }
130 }
131
83 QString resolved = UCUnits::instance()->resolveResource(m_source);132 QString resolved = UCUnits::instance()->resolveResource(m_source);
84133
85 if (resolved.isEmpty()) {134 if (resolved.isEmpty()) {
@@ -98,7 +147,9 @@
98 || selectedFilePath.endsWith(QStringLiteral(".svgz"))) {147 || selectedFilePath.endsWith(QStringLiteral(".svgz"))) {
99 // Take care to pass the original fragment148 // Take care to pass the original fragment
100 QUrl selectedFileUrl(QUrl::fromLocalFile(selectedFilePath));149 QUrl selectedFileUrl(QUrl::fromLocalFile(selectedFilePath));
101 selectedFileUrl.setFragment(fragment);150 if (m_source.hasFragment()) {
151 selectedFileUrl.setFragment(fragment);
152 }
102 m_image->setSource(selectedFileUrl);153 m_image->setSource(selectedFileUrl);
103 } else {154 } else {
104 // Need to scale the pixel-based image to suit the devicePixelRatio setting ourselves.155 // Need to scale the pixel-based image to suit the devicePixelRatio setting ourselves.
105156
=== modified file 'src/UbuntuToolkit/ucqquickimageextension_p.h'
--- src/UbuntuToolkit/ucqquickimageextension_p.h 2016-09-09 17:49:07 +0000
+++ src/UbuntuToolkit/ucqquickimageextension_p.h 2017-03-06 16:02:52 +0000
@@ -19,6 +19,7 @@
19#ifndef UCQQUICKIMAGEEXTENSION_P_H19#ifndef UCQQUICKIMAGEEXTENSION_P_H
20#define UCQQUICKIMAGEEXTENSION_P_H20#define UCQQUICKIMAGEEXTENSION_P_H
2121
22#include <QtCore/QEvent>
22#include <QtCore/QByteArray>23#include <QtCore/QByteArray>
23#include <QtCore/QObject>24#include <QtCore/QObject>
24#include <QtCore/QSharedPointer>25#include <QtCore/QSharedPointer>
2526
=== modified file 'src/UbuntuToolkit/ucslotslayout.cpp'
--- src/UbuntuToolkit/ucslotslayout.cpp 2016-10-07 14:33:47 +0000
+++ src/UbuntuToolkit/ucslotslayout.cpp 2017-03-06 16:02:52 +0000
@@ -32,6 +32,7 @@
32 : QQuickItemPrivate()32 : QQuickItemPrivate()
33 , mainSlot(Q_NULLPTR)33 , mainSlot(Q_NULLPTR)
34 , m_parentItem(Q_NULLPTR)34 , m_parentItem(Q_NULLPTR)
35 , mainSlotHeight(0)
35 , maxSlotsHeight(0)36 , maxSlotsHeight(0)
36 , _q_cachedHeight(-1)37 , _q_cachedHeight(-1)
37 , maxNumberOfLeadingSlots(1)38 , maxNumberOfLeadingSlots(1)
3839
=== modified file 'src/UbuntuToolkit/ucstylehints.cpp'
--- src/UbuntuToolkit/ucstylehints.cpp 2016-09-12 09:03:50 +0000
+++ src/UbuntuToolkit/ucstylehints.cpp 2017-03-06 16:02:52 +0000
@@ -273,6 +273,7 @@
273273
274 newBinding->setTarget(change->property());274 newBinding->setTarget(change->property());
275 PropertyChange::setBinding(change, newBinding);275 PropertyChange::setBinding(change, newBinding);
276 m_propertyBackup << change;
276 }277 }
277}278}
278279
279280
=== modified file 'src/imports/Components/1.3/ListItemPopover.qml'
--- src/imports/Components/1.3/ListItemPopover.qml 2015-07-01 12:06:34 +0000
+++ src/imports/Components/1.3/ListItemPopover.qml 2017-03-06 16:02:52 +0000
@@ -24,6 +24,7 @@
24 contentWidth: units.gu(25)24 contentWidth: units.gu(25)
2525
26 delegate: ListItem {26 delegate: ListItem {
27 visible: action.visible
27 contentItem.anchors {28 contentItem.anchors {
28 leftMargin: units.gu(2)29 leftMargin: units.gu(2)
29 rightMargin: units.gu(2)30 rightMargin: units.gu(2)
@@ -35,7 +36,7 @@
35 Label {36 Label {
36 anchors.verticalCenter: parent.verticalCenter37 anchors.verticalCenter: parent.verticalCenter
37 text: action.text38 text: action.text
38 color: '#5D5D5D'39 color: theme.palette.normal.backgroundText
39 }40 }
4041
41 onClicked: popover.hide()42 onClicked: popover.hide()
4243
=== modified file 'src/imports/Components/1.3/OptionSelector.qml'
--- src/imports/Components/1.3/OptionSelector.qml 2016-08-22 10:18:57 +0000
+++ src/imports/Components/1.3/OptionSelector.qml 2017-03-06 16:02:52 +0000
@@ -155,6 +155,12 @@
155 }155 }
156156
157 /*!157 /*!
158 \qmlproperty int count
159 This property holds the number of items in the OptionSelector.
160 */
161 property alias count: list.count
162
163 /*!
158 \qmlproperty int selectedIndex164 \qmlproperty int selectedIndex
159 The index of the currently selected element in our list.165 The index of the currently selected element in our list.
160 */166 */
161167
=== modified file 'src/imports/Components/1.3/TextField.qml'
--- src/imports/Components/1.3/TextField.qml 2017-01-18 13:00:07 +0000
+++ src/imports/Components/1.3/TextField.qml 2017-03-06 16:02:52 +0000
@@ -988,7 +988,12 @@
988 name: control.hasClearButton && !control.readOnly ? "edit-clear" : ""988 name: control.hasClearButton && !control.readOnly ? "edit-clear" : ""
989 }989 }
990990
991 onClicked: editor.text = ""991 onClicked: {
992 //FIXME: Invoke editor.clear() once the SDK moves to Qt 5.7
993 // http://doc.qt.io/qt-5/qml-qtquick-textinput.html#clear-method
994 editor.text = "";
995 Qt.inputMethod.reset();
996 }
992 }997 }
993998
994 // hint text999 // hint text
9951000
=== modified file 'src/imports/Components/1.3/UbuntuListView.qml'
--- src/imports/Components/1.3/UbuntuListView.qml 2016-10-06 15:02:31 +0000
+++ src/imports/Components/1.3/UbuntuListView.qml 2017-03-06 16:02:52 +0000
@@ -79,6 +79,7 @@
7979
80 \qml80 \qml
81 import QtQuick 2.481 import QtQuick 2.4
82 import QtQuick.XmlListModel 2.0
82 import Ubuntu.Components 1.383 import Ubuntu.Components 1.3
8384
84 UbuntuListView {85 UbuntuListView {
8586
=== modified file 'src/imports/Components/ListItems/1.3/LabelVisual.qml'
--- src/imports/Components/ListItems/1.3/LabelVisual.qml 2016-01-27 13:58:29 +0000
+++ src/imports/Components/ListItems/1.3/LabelVisual.qml 2017-03-06 16:02:52 +0000
@@ -30,7 +30,8 @@
30 return item.parent.hasOwnProperty("pointerTarget") || label.isInsideOverlay(item.parent)30 return item.parent.hasOwnProperty("pointerTarget") || label.isInsideOverlay(item.parent)
31 }31 }
3232
33 elide: Text.ElideRight33 horizontalAlignment: Qt.application.layoutDirection == Qt.RightToLeft ? Text.AlignRight: Text.AlignLeft
34 elide: Qt.application.layoutDirection == Qt.RightToLeft ? Text.ElideLeft: Text.ElideRight
34 color: selected35 color: selected
35 ? theme.palette.selected.backgroundText36 ? theme.palette.selected.backgroundText
36 : (secondary37 : (secondary
3738
=== modified file 'src/imports/Components/ListItems/1.3/ThinDivider.qml'
--- src/imports/Components/ListItems/1.3/ThinDivider.qml 2015-07-05 21:04:55 +0000
+++ src/imports/Components/ListItems/1.3/ThinDivider.qml 2017-03-06 16:02:52 +0000
@@ -47,8 +47,8 @@
47*/47*/
48Rectangle {48Rectangle {
49 anchors {49 anchors {
50 left: (parent) ? parent.left : null50 left: (parent) ? parent.left : undefined
51 right: (parent) ? parent.right : null51 right: (parent) ? parent.right : undefined
52 }52 }
53 height: (visible) ? units.dp(2) : 053 height: (visible) ? units.dp(2) : 0
54 // a private property to catch theme background color change54 // a private property to catch theme background color change
5555
=== modified file 'src/imports/Components/Popups/1.3/popupUtils.js'
--- src/imports/Components/Popups/1.3/popupUtils.js 2017-01-16 17:03:26 +0000
+++ src/imports/Components/Popups/1.3/popupUtils.js 2017-03-06 16:02:52 +0000
@@ -72,7 +72,7 @@
7272
73 var popupObject;73 var popupObject;
74 // If there's an active item, save it so we can restore it later74 // If there's an active item, save it so we can restore it later
75 var prevFocusItem = (typeof window !== "undefined") ? window.activeFocusItem : null;75 var prevFocusItem = (typeof window !== "undefined") && window ? window.activeFocusItem : null;
76 if (params !== undefined) {76 if (params !== undefined) {
77 popupObject = popupComponent.createObject(rootObject, params);77 popupObject = popupComponent.createObject(rootObject, params);
78 } else {78 } else {
7979
=== modified file 'src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml'
--- src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2016-01-27 15:17:56 +0000
+++ src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml 2017-03-06 16:02:52 +0000
@@ -57,7 +57,7 @@
57 property real iconPadding: units.gu(0.4)57 property real iconPadding: units.gu(0.4)
5858
59 implicitWidth: units.gu(2)59 implicitWidth: units.gu(2)
60 implicitHeight: units.gu(2)60 implicitHeight: Math.max(checkBoxLbl.contentHeight, units.gu(2))
6161
62 FocusShape {62 FocusShape {
63 }63 }
@@ -65,10 +65,12 @@
65 UbuntuShape {65 UbuntuShape {
66 id: background66 id: background
67 anchors {67 anchors {
68 fill: parent
69 margins: checkBoxStyle.backgroundPadding68 margins: checkBoxStyle.backgroundPadding
70 }69 }
71 property real iconSize: Math.min(width, height) - 2*checkBoxStyle.iconPadding70 width: units.gu(2)
71 height: units.gu(2)
72
73 property real iconSize: units.gu(2) - 2*checkBoxStyle.iconPadding
7274
73 Icon {75 Icon {
74 color: checkBoxStyle.iconColor76 color: checkBoxStyle.iconColor
@@ -164,4 +166,16 @@
164 }166 }
165 ]167 ]
166 }168 }
169
170 Label {
171 id: checkBoxLbl
172 text: styledItem.text
173 anchors.left: background.right
174 anchors.leftMargin: units.gu(1)
175 anchors.right: parent.right
176 height: parent.height
177 enabled: styledItem.enabled
178 visible: styledItem.text
179 wrapMode: Text.WordWrap
180 }
167}181}
168182
=== modified file 'src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-09-19 07:24:45 +0000
+++ src/imports/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2017-03-06 16:02:52 +0000
@@ -121,6 +121,7 @@
121 id: titleLabel121 id: titleLabel
122 objectName: "header_title_label"122 objectName: "header_title_label"
123 text: styledItem.title123 text: styledItem.title
124 horizontalAlignment: Qt.application.layoutDirection == Qt.RightToLeft ? Text.AlignRight: Text.AlignLeft
124125
125 anchors {126 anchors {
126 left: parent.left127 left: parent.left
@@ -131,7 +132,7 @@
131 color: pageHeaderStyle.foregroundColor132 color: pageHeaderStyle.foregroundColor
132 font.weight: pageHeaderStyle.fontWeight133 font.weight: pageHeaderStyle.fontWeight
133 textSize: pageHeaderStyle.textSize134 textSize: pageHeaderStyle.textSize
134 elide: Text.ElideRight135 elide: Qt.application.layoutDirection == Qt.RightToLeft ? Text.ElideLeft: Text.ElideRight
135 }136 }
136 }137 }
137 }138 }
138139
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2016-08-12 11:42:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2017-03-06 16:02:52 +0000
@@ -79,6 +79,8 @@
79 name = introspection.get_classname_from_path(path)79 name = introspection.get_classname_from_path(path)
80 if name == b'OverflowPanel':80 if name == b'OverflowPanel':
81 return True81 return True
82 if name == b'ListItemPopover':
83 return True
8284
83 return False85 return False
8486
8587
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.ListItemTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.ListItemTestCase.qml 2015-03-03 13:20:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.ListItemTestCase.qml 2017-03-06 16:02:52 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.218import Ubuntu.Components 1.3
1919
20MainView {20MainView {
21 width: units.gu(48)21 width: units.gu(48)
@@ -25,7 +25,10 @@
25 Page {25 Page {
26 id: testPage26 id: testPage
27 objectName: "test_page"27 objectName: "test_page"
28 title: listView.ViewItems.selectMode ? "In selection mode" : "No action triggered"28 header: PageHeader {
29 objectName: 'test_header'
30 title: listView.ViewItems.selectMode ? "In selection mode" : "No action triggered"
31 }
29 ListView {32 ListView {
30 id: listView33 id: listView
31 objectName: "test_view"34 objectName: "test_view"
@@ -40,6 +43,10 @@
40 iconName: "delete"43 iconName: "delete"
41 objectName: 'delete_action'44 objectName: 'delete_action'
42 onTriggered: testPage.title = objectName + " action triggered";45 onTriggered: testPage.title = objectName + " action triggered";
46 },
47 Action {
48 visible: false
49 objectName: 'invisible_action'
43 }50 }
44 ]51 ]
45 }52 }
4653
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2015-09-22 15:56:35 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitem.py 2017-03-06 16:02:52 +0000
@@ -17,6 +17,7 @@
17import os17import os
1818
19import ubuntuuitoolkit19import ubuntuuitoolkit
20from autopilot.introspection import dbus
20from ubuntuuitoolkit import tests21from ubuntuuitoolkit import tests
2122
2223
@@ -34,7 +35,9 @@
34 'UCListItem', objectName='listitem0')35 'UCListItem', objectName='listitem0')
35 self.test_page = self.main_view.select_single(36 self.test_page = self.main_view.select_single(
36 objectName='test_page')37 objectName='test_page')
37 self.assertEqual(self.test_page.title, 'No action triggered')38 header = self.test_page.select_single(
39 'PageHeader', objectName='test_header')
40 self.assertEqual(header.title, 'No action triggered')
3841
39 def test_trigger_delete(self):42 def test_trigger_delete(self):
40 self.test_listitem.trigger_leading_action('delete_action')43 self.test_listitem.trigger_leading_action('delete_action')
@@ -96,3 +99,12 @@
96 'UCListItem', objectName='listitem3')99 'UCListItem', objectName='listitem3')
97 listItem3.toggle_selected()100 listItem3.toggle_selected()
98 self.assertTrue(listItem3.selected)101 self.assertTrue(listItem3.selected)
102
103 def test_popover(self):
104 self.pointing_device.click_object(self.test_listitem, button=3)
105 popover = self.main_view.wait_select_single(
106 'ListItemPopover', objectName='listItemContextMenu')
107 self.assertRaises(
108 ubuntuuitoolkit._custom_proxy_objects._common.ToolkitException,
109 popover.click_action_button, 'invisible_action')
110 popover.click_action_button('delete_action')
99111
=== modified file 'tests/unit/components/tst_sortfiltermodel.qml'
--- tests/unit/components/tst_sortfiltermodel.qml 2015-03-03 13:20:06 +0000
+++ tests/unit/components/tst_sortfiltermodel.qml 2017-03-06 16:02:52 +0000
@@ -25,7 +25,7 @@
25 id: things25 id: things
26 ListElement { foo: "pub"; alpha: "bee"; num: 200 }26 ListElement { foo: "pub"; alpha: "bee"; num: 200 }
27 ListElement { foo: "den"; alpha: "cow"; num: 300 }27 ListElement { foo: "den"; alpha: "cow"; num: 300 }
28 ListElement { foo: "bar"; alpha: "ant"; num: 100 }28 ListElement { foo: "Bar"; alpha: "ant"; num: 100 }
29 }29 }
3030
31 SortFilterModel {31 SortFilterModel {
@@ -72,6 +72,13 @@
72 filter.pattern: /e/72 filter.pattern: /e/
73 }73 }
7474
75 SortFilterModel {
76 id: caseSensitivity
77 model: things
78 filter.property: "foo"
79 filter.pattern: /bar/i
80 }
81
75 function test_passthrough() {82 function test_passthrough() {
76 compare(unmodified.count, things.count)83 compare(unmodified.count, things.count)
77 }84 }
@@ -84,7 +91,7 @@
84 compare(alphabetic.get(2).alpha, "cow")91 compare(alphabetic.get(2).alpha, "cow")
8592
86 // Ensure different columns work also93 // Ensure different columns work also
87 compare(alphaSecond.get(0).foo, "bar")94 compare(alphaSecond.get(0).foo, "Bar")
8895
89 // Descending96 // Descending
90 compare(alphabeticRe.sort.order, Qt.DescendingOrder)97 compare(alphabeticRe.sort.order, Qt.DescendingOrder)
@@ -98,7 +105,7 @@
98105
99 // Changing roles106 // Changing roles
100 alphabetic.sort.property = "foo"107 alphabetic.sort.property = "foo"
101 compare(alphabetic.get(0).foo, "bar")108 compare(alphabetic.get(0).foo, "Bar")
102 compare(alphabetic.get(1).foo, "den")109 compare(alphabetic.get(1).foo, "den")
103 compare(alphabetic.get(2).foo, "pub")110 compare(alphabetic.get(2).foo, "pub")
104 // Sanity check111 // Sanity check
@@ -120,4 +127,8 @@
120 compare(bee.count, 1)127 compare(bee.count, 1)
121 compare(bee.get(0).alpha, "bee")128 compare(bee.get(0).alpha, "bee")
122 }129 }
130
131 function test_case_sensitivity() {
132 compare(caseSensitivity.get(0).foo, "Bar")
133 }
123}134}
124135
=== modified file 'tests/unit/contenthub/tst_contenthub.cpp'
--- tests/unit/contenthub/tst_contenthub.cpp 2017-01-26 16:02:48 +0000
+++ tests/unit/contenthub/tst_contenthub.cpp 2017-03-06 16:02:52 +0000
@@ -68,12 +68,10 @@
68 tst_UCContentHub() {}68 tst_UCContentHub() {}
6969
70private:70private:
71 MockContentService *mockService;71 MockContentService *mockService{nullptr};
72 UCContentHub *contentHub;72 UCContentHub *contentHub{nullptr};
73 QSignalSpy *pasteRequestedSpy;73 QSignalSpy *pasteRequestedSpy{nullptr};
74 QSignalSpy *pasteSelectedSpy;74 QSignalSpy *pasteSelectedSpy{nullptr};
75
76 const int testTimeout = 5000;
7775
78 const QString dummyAppId = "DummyAppId";76 const QString dummyAppId = "DummyAppId";
7977
@@ -143,11 +141,11 @@
143 QDBusConnection connection = QDBusConnection::sessionBus();141 QDBusConnection connection = QDBusConnection::sessionBus();
144 connection.registerObject("/", mockService);142 connection.registerObject("/", mockService);
145 connection.registerService("com.ubuntu.content.dbus.Service");143 connection.registerService("com.ubuntu.content.dbus.Service");
146 pasteRequestedSpy = new QSignalSpy(mockService, SIGNAL(PasteRequested()));144 pasteRequestedSpy = new QSignalSpy(mockService, &MockContentService::PasteRequested);
147145
148 qRegisterMetaType<QQuickItem*>();146 qRegisterMetaType<QQuickItem*>();
149 contentHub = new UCContentHub();147 contentHub = new UCContentHub();
150 pasteSelectedSpy = new QSignalSpy(contentHub, SIGNAL(pasteSelected(QQuickItem*, const QString&)));148 pasteSelectedSpy = new QSignalSpy(contentHub, &UCContentHub::pasteSelected);
151 }149 }
152150
153 void cleanupTestCase()151 void cleanupTestCase()
@@ -155,6 +153,7 @@
155 delete pasteRequestedSpy;153 delete pasteRequestedSpy;
156 delete pasteSelectedSpy;154 delete pasteSelectedSpy;
157 delete contentHub;155 delete contentHub;
156 delete mockService;
158 }157 }
159158
160 void cleanup()159 void cleanup()
@@ -187,8 +186,7 @@
187 QMimeData textPaste;186 QMimeData textPaste;
188 textPaste.setText(sampleHtml);187 textPaste.setText(sampleHtml);
189 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(textPaste), false);188 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(textPaste), false);
190 pasteSelectedSpy->wait(testTimeout);189 QTRY_COMPARE(pasteSelectedSpy->count(), 1);
191 QCOMPARE(pasteSelectedSpy->count(), 1);
192 QList<QVariant> args = pasteSelectedSpy->takeFirst();190 QList<QVariant> args = pasteSelectedSpy->takeFirst();
193 QVERIFY(args.at(1).toString() == textPaste.text());191 QVERIFY(args.at(1).toString() == textPaste.text());
194 }192 }
@@ -198,8 +196,7 @@
198 QMimeData htmlPaste;196 QMimeData htmlPaste;
199 htmlPaste.setHtml(sampleHtml);197 htmlPaste.setHtml(sampleHtml);
200 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(htmlPaste), false);198 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(htmlPaste), false);
201 pasteSelectedSpy->wait(testTimeout);199 QTRY_COMPARE(pasteSelectedSpy->count(), 1);
202 QCOMPARE(pasteSelectedSpy->count(), 1);
203 QList<QVariant> args = pasteSelectedSpy->takeFirst();200 QList<QVariant> args = pasteSelectedSpy->takeFirst();
204 QVERIFY(args.at(1).toString() == htmlPaste.text());201 QVERIFY(args.at(1).toString() == htmlPaste.text());
205 }202 }
@@ -209,8 +206,7 @@
209 QMimeData htmlPaste;206 QMimeData htmlPaste;
210 htmlPaste.setHtml(sampleHtml);207 htmlPaste.setHtml(sampleHtml);
211 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(htmlPaste), true);208 contentHub->onPasteSelected(contentHub->getAppProfile(), serializeMimeData(htmlPaste), true);
212 pasteSelectedSpy->wait(testTimeout);209 QTRY_COMPARE(pasteSelectedSpy->count(), 1);
213 QCOMPARE(pasteSelectedSpy->count(), 1);
214 QList<QVariant> args = pasteSelectedSpy->takeFirst();210 QList<QVariant> args = pasteSelectedSpy->takeFirst();
215 QVERIFY(args.at(1).toString() == htmlPaste.html());211 QVERIFY(args.at(1).toString() == htmlPaste.html());
216 }212 }
@@ -220,8 +216,7 @@
220 QMimeData textPaste;216 QMimeData textPaste;
221 textPaste.setText(sampleText);217 textPaste.setText(sampleText);
222 contentHub->onPasteSelected(dummyAppId, serializeMimeData(textPaste), false);218 contentHub->onPasteSelected(dummyAppId, serializeMimeData(textPaste), false);
223 pasteSelectedSpy->wait(testTimeout);219 QTRY_COMPARE(pasteSelectedSpy->count(), 0);
224 QCOMPARE(pasteSelectedSpy->count(), 0);
225 }220 }
226221
227 void test_KeyboardShortcutOnTextField()222 void test_KeyboardShortcutOnTextField()
@@ -230,10 +225,10 @@
230 testCase->rootObject()->forceActiveFocus();225 testCase->rootObject()->forceActiveFocus();
231 QQuickItem *textField = testCase->findItem<QQuickItem*>("textField");226 QQuickItem *textField = testCase->findItem<QQuickItem*>("textField");
232 QTest::keyClick(textField->window(), Qt::Key_Tab);227 QTest::keyClick(textField->window(), Qt::Key_Tab);
233 QTRY_COMPARE_WITH_TIMEOUT(textField->property("activeFocus").toBool(), true, testTimeout);228 QTRY_COMPARE(textField->property("activeFocus").toBool(), true);
229 QTRY_COMPARE(contentHub->canPaste(), true);
234 QTest::keyClick(textField->window(), Qt::Key_V, Qt::ControlModifier|Qt::ShiftModifier);230 QTest::keyClick(textField->window(), Qt::Key_V, Qt::ControlModifier|Qt::ShiftModifier);
235 pasteRequestedSpy->wait(testTimeout);231 QTRY_COMPARE(pasteRequestedSpy->count(), 1);
236 QCOMPARE(pasteRequestedSpy->count(), 1);
237 }232 }
238 233
239 void test_KeyboardShortcutOnTextArea()234 void test_KeyboardShortcutOnTextArea()
@@ -242,10 +237,10 @@
242 testCase->rootObject()->forceActiveFocus();237 testCase->rootObject()->forceActiveFocus();
243 QQuickItem *textArea = testCase->findItem<QQuickItem*>("textArea");238 QQuickItem *textArea = testCase->findItem<QQuickItem*>("textArea");
244 QTest::keyClick(textArea->window(), Qt::Key_Tab);239 QTest::keyClick(textArea->window(), Qt::Key_Tab);
245 QTRY_COMPARE_WITH_TIMEOUT(textArea->property("activeFocus").toBool(), true, testTimeout);240 QTRY_COMPARE(textArea->property("activeFocus").toBool(), true);
241 QTRY_COMPARE(contentHub->canPaste(), true);
246 QTest::keyClick(textArea->window(), Qt::Key_V, Qt::ControlModifier|Qt::ShiftModifier);242 QTest::keyClick(textArea->window(), Qt::Key_V, Qt::ControlModifier|Qt::ShiftModifier);
247 pasteRequestedSpy->wait(testTimeout);243 QTRY_COMPARE(pasteRequestedSpy->count(), 1);
248 QCOMPARE(pasteRequestedSpy->count(), 1);
249 }244 }
250};245};
251246
252247
=== modified file 'tests/unit/mainwindow/VisualRoot.qml'
--- tests/unit/mainwindow/VisualRoot.qml 2017-01-16 14:18:21 +0000
+++ tests/unit/mainwindow/VisualRoot.qml 2017-03-06 16:02:52 +0000
@@ -20,7 +20,6 @@
2020
21MainWindow {21MainWindow {
22 objectName: "visualRoot"22 objectName: "visualRoot"
23 applicationName: "org.gnu.wildebeest"
24 visualRoot: myRoot23 visualRoot: myRoot
2524
26 Rectangle {25 Rectangle {
2726
=== modified file 'tests/unit/mainwindow/tst_mainwindow.cpp'
--- tests/unit/mainwindow/tst_mainwindow.cpp 2017-01-16 17:44:23 +0000
+++ tests/unit/mainwindow/tst_mainwindow.cpp 2017-03-06 16:02:52 +0000
@@ -33,10 +33,7 @@
33#include <QtCore/QCryptographicHash>33#include <QtCore/QCryptographicHash>
34#include <QtCore/QSettings>34#include <QtCore/QSettings>
3535
36#include <QtQuick/QQuickItem>
37#include <QtQuick/QQuickView>
38#include <QtGui/QGuiApplication>36#include <QtGui/QGuiApplication>
39#include <QtQml/QQmlEngine>
40#include <QtQml/QQmlContext>37#include <QtQml/QQmlContext>
41#include <QtQml/QQmlComponent>38#include <QtQml/QQmlComponent>
4239
@@ -103,18 +100,22 @@
103100
104private Q_SLOTS:101private Q_SLOTS:
105102
106 void initTestCase()103 void cleanup()
107 {104 {
108 }105 // Delete engine, and thereby also the UCApplication instance
109106 QObject* engine(UCApplication::instance()->parent());
110 void cleanupTestCase()107 delete engine;
111 {108 QCoreApplication::setApplicationName(QStringLiteral(""));
109 QCoreApplication::setOrganizationName(QStringLiteral(""));
112 }110 }
113111
114 // Note: tests/unit/mainview13 contains the UCApplication bits112 // Note: tests/unit/mainview13 contains the UCApplication bits
115113
116 void testCase_AppName()114 void testCase_AppName()
117 {115 {
116 // Sanity check: no name set yet
117 QCOMPARE(QStringLiteral("mainwindow"), QCoreApplication::applicationName());
118
118 QString applicationName("org.gnu.wildebeest");119 QString applicationName("org.gnu.wildebeest");
119 QQuickWindow *mainWindow(loadTest("AppName.qml"));120 QQuickWindow *mainWindow(loadTest("AppName.qml"));
120 QVERIFY(mainWindow);121 QVERIFY(mainWindow);
@@ -125,6 +126,9 @@
125126
126 void testCase_OrganizationName()127 void testCase_OrganizationName()
127 {128 {
129 // Sanity check: no organization set yet
130 QCOMPARE(QStringLiteral(""), QCoreApplication::organizationName());
131
128 QString applicationName("tv.island.pacific");132 QString applicationName("tv.island.pacific");
129 QString organizationName("pacifist");133 QString organizationName("pacifist");
130 QQuickWindow *mainWindow(loadTest("OrganizationName.qml"));134 QQuickWindow *mainWindow(loadTest("OrganizationName.qml"));
@@ -135,9 +139,28 @@
135 QCOMPARE(organizationName, QCoreApplication::organizationName());139 QCOMPARE(organizationName, QCoreApplication::organizationName());
136 }140 }
137141
142 void testCase_NoOrganizationName()
143 {
144 // Sanity check: no organization set yet
145 QCOMPARE(QStringLiteral(""), QCoreApplication::organizationName());
146
147 // Custom values set outside of QML
148 QString applicationName("com.example.random");
149 QString organizationName(QStringLiteral("Example"));
150 QCoreApplication::setApplicationName(applicationName);
151 QCoreApplication::setOrganizationName(organizationName);
152
153 QQuickWindow *mainWindow(loadTest("VisualRoot.qml"));
154 QVERIFY(mainWindow);
155 // MainView shouldn't interfere as applicationName wasn't set in QML
156 QCOMPARE(QStringLiteral(""), mainWindow->property("applicationName").toString());
157 QCOMPARE(applicationName, QCoreApplication::applicationName());
158 QCOMPARE(QStringLiteral(""), mainWindow->property("organizationName").toString());
159 QCOMPARE(organizationName, QCoreApplication::organizationName());
160 }
161
138 void testCase_VisualRoot()162 void testCase_VisualRoot()
139 {163 {
140 QString applicationName("tv.island.pacific");
141 QQuickWindow *mainWindow(loadTest("VisualRoot.qml"));164 QQuickWindow *mainWindow(loadTest("VisualRoot.qml"));
142 QVERIFY(mainWindow);165 QVERIFY(mainWindow);
143 QQuickItem* myLabel(testItem(mainWindow, "myLabel"));166 QQuickItem* myLabel(testItem(mainWindow, "myLabel"));
144167
=== removed file 'tests/unit/qquick_image_extension/borderInName.sci'
--- tests/unit/qquick_image_extension/borderInName.sci 2013-05-06 16:33:54 +0000
+++ tests/unit/qquick_image_extension/borderInName.sci 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1source: "borderInName.png"
2border.left: 9
3border.right: 2
4border.top: 9
5border.bottom: 0
6horizontalTileMode: Stretch
7verticalTileMode: Stretch
80
=== added directory 'tests/unit/qquick_image_extension/data'
=== added file 'tests/unit/qquick_image_extension/data/borderInName.sci'
--- tests/unit/qquick_image_extension/data/borderInName.sci 1970-01-01 00:00:00 +0000
+++ tests/unit/qquick_image_extension/data/borderInName.sci 2017-03-06 16:02:52 +0000
@@ -0,0 +1,7 @@
1source: "borderInName.png"
2border.left: 9
3border.right: 2
4border.top: 9
5border.bottom: 0
6horizontalTileMode: Stretch
7verticalTileMode: Stretch
08
=== added file 'tests/unit/qquick_image_extension/data/face.png'
1Binary files tests/unit/qquick_image_extension/data/face.png 1970-01-01 00:00:00 +0000 and tests/unit/qquick_image_extension/data/face.png 2017-03-06 16:02:52 +0000 differ9Binary files tests/unit/qquick_image_extension/data/face.png 1970-01-01 00:00:00 +0000 and tests/unit/qquick_image_extension/data/face.png 2017-03-06 16:02:52 +0000 differ
=== added file 'tests/unit/qquick_image_extension/data/hundred_faces.qml'
--- tests/unit/qquick_image_extension/data/hundred_faces.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/qquick_image_extension/data/hundred_faces.qml 2017-03-06 16:02:52 +0000
@@ -0,0 +1,13 @@
1
2import QtQuick 2.4
3import Ubuntu.Components 1.3
4
5Repeater {
6 width: 400
7 height: 600
8
9 model: 100
10 delegate: Image {
11 source: "face.png"
12 }
13}
014
=== added file 'tests/unit/qquick_image_extension/data/test@18.sci'
--- tests/unit/qquick_image_extension/data/test@18.sci 1970-01-01 00:00:00 +0000
+++ tests/unit/qquick_image_extension/data/test@18.sci 2017-03-06 16:02:52 +0000
@@ -0,0 +1,7 @@
1source: "test@18.png"
2border.left: 9
3border.right: 2
4border.top: 9
5border.bottom: 0
6horizontalTileMode: Stretch
7verticalTileMode: Stretch
08
=== modified file 'tests/unit/qquick_image_extension/qquick_image_extension.pro'
--- tests/unit/qquick_image_extension/qquick_image_extension.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/qquick_image_extension/qquick_image_extension.pro 2017-03-06 16:02:52 +0000
@@ -1,3 +1,3 @@
1include(../test-include.pri)1include(../test-include.pri)
2SOURCES += tst_qquick_image_extension.cpp2SOURCES += tst_qquick_image_extension.cpp
3QT += quick-private3QT += core-private quick-private
44
=== removed file 'tests/unit/qquick_image_extension/test@18.sci'
--- tests/unit/qquick_image_extension/test@18.sci 2013-05-06 16:33:54 +0000
+++ tests/unit/qquick_image_extension/test@18.sci 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1source: "test@18.png"
2border.left: 9
3border.right: 2
4border.top: 9
5border.bottom: 0
6horizontalTileMode: Stretch
7verticalTileMode: Stretch
80
=== modified file 'tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp'
--- tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp 2016-09-09 17:49:07 +0000
+++ tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp 2017-03-06 16:02:52 +0000
@@ -23,6 +23,8 @@
23#define protected public23#define protected public
24#include <UbuntuToolkit/private/ucqquickimageextension_p.h>24#include <UbuntuToolkit/private/ucqquickimageextension_p.h>
25#undef protected25#undef protected
26#include <QtCore/private/qabstractfileengine_p.h>
27#include <QQuickView>
2628
27UT_USE_NAMESPACE29UT_USE_NAMESPACE
2830
@@ -32,6 +34,20 @@
32 return QDir::temp().entryList(nameFilters, QDir::Files).count();34 return QDir::temp().entryList(nameFilters, QDir::Files).count();
33}35}
3436
37int nFaces = 0;
38
39class DummyFileEngineHandler : public QAbstractFileEngineHandler
40{
41public:
42 QAbstractFileEngine *create(const QString &fileName) const
43 {
44 if (fileName.endsWith("/face.png"))
45 nFaces++;
46
47 return nullptr;
48 }
49};
50
35class tst_UCQQuickImageExtension : public QObject51class tst_UCQQuickImageExtension : public QObject
36{52{
37 Q_OBJECT53 Q_OBJECT
@@ -78,7 +94,7 @@
7894
79 void rewriteContainsBorderInName() {95 void rewriteContainsBorderInName() {
80 UCQQuickImageExtension image;96 UCQQuickImageExtension image;
81 QString sciFilePath = "borderInName.sci";97 QString sciFilePath = "data/borderInName.sci";
82 QString result;98 QString result;
8399
84 QTextStream resultStream(&result);100 QTextStream resultStream(&result);
@@ -86,7 +102,7 @@
86102
87 QString expected;103 QString expected;
88 QTextStream expectedStream(&expected);104 QTextStream expectedStream(&expected);
89 expectedStream << "source: \"image://scaling/1/./borderInName.png\"" << endl;105 expectedStream << "source: \"image://scaling/1/data/borderInName.png\"" << endl;
90 expectedStream << "border.left: 9" << endl;106 expectedStream << "border.left: 9" << endl;
91 expectedStream << "border.right: 2" << endl;107 expectedStream << "border.right: 2" << endl;
92 expectedStream << "border.top: 9" << endl;108 expectedStream << "border.top: 9" << endl;
@@ -105,7 +121,7 @@
105 QQuickImageBase baseImage;121 QQuickImageBase baseImage;
106 UCQQuickImageExtension* image1 = new UCQQuickImageExtension(&baseImage);122 UCQQuickImageExtension* image1 = new UCQQuickImageExtension(&baseImage);
107 UCQQuickImageExtension* image2 = new UCQQuickImageExtension(&baseImage);123 UCQQuickImageExtension* image2 = new UCQQuickImageExtension(&baseImage);
108 QUrl sciFileUrl = QUrl::fromLocalFile("./test.sci");124 QUrl sciFileUrl = QUrl::fromLocalFile("./data/test.sci");
109125
110 unsigned int initialNumberOfSciFiles = numberOfTemporarySciFiles();126 unsigned int initialNumberOfSciFiles = numberOfTemporarySciFiles();
111127
@@ -124,6 +140,25 @@
124 delete image2;140 delete image2;
125 QCOMPARE(numberOfTemporarySciFiles(), initialNumberOfSciFiles + 1);141 QCOMPARE(numberOfTemporarySciFiles(), initialNumberOfSciFiles + 1);
126 }142 }
143
144 void onlyOneStatRepeatedImage() {
145 DummyFileEngineHandler handler;
146
147 QQuickView view(QUrl::fromLocalFile("./data/hundred_faces.qml"));
148
149 // Wait until the app is idle
150 bool idle = false;
151 while (!idle) {
152 QEventLoop l;
153 idle = !l.processEvents();
154 }
155 // We have actually loaded the image
156 QVERIFY(nFaces > 0);
157 // The number at the moment of writing this test is 4, but we
158 // can't know what Qt does internally, so i'm going for a relatively safe <10
159 // the important part is that is not 100 times (i.e. one for every Image item)
160 QVERIFY(nFaces < 10);
161 }
127};162};
128163
129QTEST_MAIN(tst_UCQQuickImageExtension)164QTEST_MAIN(tst_UCQQuickImageExtension)
130165
=== modified file 'tests/unit/visual/tst_optionselector.13.qml'
--- tests/unit/visual/tst_optionselector.13.qml 2016-09-19 11:13:19 +0000
+++ tests/unit/visual/tst_optionselector.13.qml 2017-03-06 16:02:52 +0000
@@ -183,8 +183,17 @@
183 function test_custom_data() {183 function test_custom_data() {
184 return test_arrow_select_data()184 return test_arrow_select_data()
185 }185 }
186
186 function test_custom(data) {187 function test_custom(data) {
187 test_arrow_select(data, customSelector, 2);188 test_arrow_select(data, customSelector, 2);
188 }189 }
190
191 function test_count() {
192 var selector = defaultSelector;
193 sections.selectedIndex = 0;
194 selector.forceActiveFocus();
195 waitForRendering(selector);
196 compare(selector.count, customModel.count);
197 }
189 }198 }
190}199}
191200
=== modified file 'tests/unit/visual/tst_toggles.13.qml'
--- tests/unit/visual/tst_toggles.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_toggles.13.qml 2017-03-06 16:02:52 +0000
@@ -39,6 +39,23 @@
39 property bool checkedNow: true39 property bool checkedNow: true
40 onClicked: checkedNow = checked40 onClicked: checkedNow = checked
41 }41 }
42
43 CheckBox {
44 id: testCheckLbl
45 checked: true
46 text: "This a checkbox label"
47 property bool checkedNow: true
48 onClicked: checkedNow = checked
49 }
50
51 CheckBox {
52 id: testCheckLblDisabled
53 checked: false
54 enabled: false
55 text: "This a checkbox label"
56 property bool checkedNow: false
57 onClicked: checkedNow = checked
58 }
42 }59 }
4360
44 UbuntuTestCase {61 UbuntuTestCase {
@@ -75,6 +92,37 @@
75 clickedSpy.wait(400);92 clickedSpy.wait(400);
76 compare(data.testItem.checkedNow, data.testItem.checked);93 compare(data.testItem.checkedNow, data.testItem.checked);
77 }94 }
95
96
97 function test_toggle_lbl_checked_data() {
98 return [
99 {tag: "CheckBox", testItem: testCheckLbl, mouse: true},
100 ];
101 }
102
103 function test_toggle_lbl_checked(data) {
104 data.testItem.checkedNow = data.testItem.checked;
105 data.testItem.forceActiveFocus();
106 clickedSpy.target = data.testItem;
107 mouseClick(data.testItem, centerOf(data.testItem).x, centerOf(data.testItem).y);
108 clickedSpy.wait(400);
109 compare(data.testItem.checkedNow, data.testItem.checked);
110 }
111
112 function test_toggle_lbl_checked_disabled_data() {
113 return [
114 {tag: "CheckBox", testItem: testCheckLblDisabled, mouse: true},
115 ];
116 }
117
118 function test_toggle_lbl_checked_disabled(data) {
119 data.testItem.checkedNow = data.testItem.checked;
120 data.testItem.forceActiveFocus();
121 clickedSpy.target = data.testItem;
122 mouseClick(data.testItem, centerOf(data.testItem).x, centerOf(data.testItem).y);
123 compare(clickedSpy.count, 0);
124 compare(data.testItem.checkedNow, data.testItem.checked);
125 }
78 }126 }
79}127}
80128

Subscribers

People subscribed via source and target branches

to status/vote changes: