on xenial help sign in
Merge from trunk
b81b329Michael Terry
debian/changelog+16
@@ -1,3 +1,19 @@
1+unity8 (7.84+14.04.20140304-0ubuntu1) trusty; urgency=low
2+
3+ [ Michael Terry ]
4+ * Ensure that the selected() signal is emitted by the greeter on
5+ startup, fixing the background on startup for the first user in
6+ tablet mode.
7+
8+ [ Nick Dedekind ]
9+ * Remocked IndicatorModel to fix qt5.2.1 changes.
10+
11+ [ Albert Astals ]
12+ * Initialize m_distance (LP: #1285385)
13+ * import Ubuntu.Components so we can use UbuntuAnimation
14+
15+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 04 Mar 2014 11:43:04 +0000
16+
1unity8 (7.84+14.04.20140228-0ubuntu1) trusty; urgency=low
17unity8 (7.84+14.04.20140228-0ubuntu1) trusty; urgency=low
2
18
3 [ Michał Sawicz ]
19 [ Michał Sawicz ]
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1
@@ -109,6 +109,7 @@ private:
109DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
109DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
110 : QQuickItem(parent)
110 : QQuickItem(parent)
111 , m_status(WaitingForTouch)
111 , m_status(WaitingForTouch)
112+ , m_sceneDistance(0)
112 , m_touchId(-1)
113 , m_touchId(-1)
113 , m_direction(Direction::Rightwards)
114 , m_direction(Direction::Rightwards)
114 , m_wideningAngle(0)
115 , m_wideningAngle(0)
plugins/Unity/Indicators/qml/MenuItemFactory.qml+1
@@ -22,6 +22,7 @@ import Ubuntu.Settings.Menus 0.1 as Menus
22import QMenuModel 0.1 as QMenuModel
22import QMenuModel 0.1 as QMenuModel
23import Utils 0.1 as Utils
23import Utils 0.1 as Utils
24import Ubuntu.Components.ListItems 0.1 as ListItems
24import Ubuntu.Components.ListItems 0.1 as ListItems
25+import Ubuntu.Components 0.1
25
26
26Item {
27Item {
27 id: menuFactory
28 id: menuFactory
po/tr.po+15−13
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2014-01-14 19:05+0000\n"
11+"PO-Revision-Date: 2014-03-05 08:54+0000\n"
12−"Last-Translator: Osman Coşkun <Unknown>\n"
12+"Last-Translator: Muhammed Yüce <muhammedyuceee@gmail.com>\n"
13"Language-Team: Turkish <tr@li.org>\n"
13"Language-Team: Turkish <tr@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2014-02-19 05:44+0000\n"
18+"X-Launchpad-Export-Date: 2014-03-06 06:19+0000\n"
19−"X-Generator: Launchpad (build 16916)\n"
19+"X-Generator: Launchpad (build 16948)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
22#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -29,7 +29,7 @@ msgstr "Başlatıcıdan Ayır"
29
29
30#: qml/Components/EdgeDemoOverlay.qml:151
30#: qml/Components/EdgeDemoOverlay.qml:151
31msgid "Skip intro"
31msgid "Skip intro"
32−msgstr "İntro'yu geç"
32+msgstr "Tanıtımı geç"
33
33
34#: qml/Components/EdgeDemo.qml:113
34#: qml/Components/EdgeDemo.qml:113
35msgid "Right edge"
35msgid "Right edge"
@@ -37,7 +37,7 @@ msgstr "Sağ kenar"
37
37
38#: qml/Components/EdgeDemo.qml:114
38#: qml/Components/EdgeDemo.qml:114
39msgid "Try swiping from the right edge to unlock the phone"
39msgid "Try swiping from the right edge to unlock the phone"
40−msgstr "Kilidi açmak için sağ kenara sürüklemeyi deneyin"
40+msgstr "Kilidi açmak için sağ kenardan sürüklemeyi deneyin"
41
41
42#: qml/Components/EdgeDemo.qml:145
42#: qml/Components/EdgeDemo.qml:145
43msgid "Top edge"
43msgid "Top edge"
@@ -45,7 +45,7 @@ msgstr "Üst kenar"
45
45
46#: qml/Components/EdgeDemo.qml:146
46#: qml/Components/EdgeDemo.qml:146
47msgid "Try swiping from the top edge to access the indicators"
47msgid "Try swiping from the top edge to access the indicators"
48−msgstr "Bildiricilere erişmek için üst kenarı sürüklemeyi deneyin"
48+msgstr "Bildiricilere erişmek için üst kenarı sürükleyin"
49
49
50#: qml/Components/EdgeDemo.qml:171
50#: qml/Components/EdgeDemo.qml:171
51msgid "Close"
51msgid "Close"
@@ -73,18 +73,20 @@ msgid ""
73"You have now mastered the edge gestures and can start using the "
73"You have now mastered the edge gestures and can start using the "
74"phone<br><br>Tap on the screen to start"
74"phone<br><br>Tap on the screen to start"
75msgstr ""
75msgstr ""
76+"Kenar haraketlerini öğrendiniz ve telefonu kullanmaya "
77+"başlayabilirsiniz<br><br>Başlamak için ekrana dokunun"
76
78
77#: qml/Components/PageHeader.qml:340
79#: qml/Components/PageHeader.qml:340
78msgid "Recent searches"
80msgid "Recent searches"
79−msgstr "Son Arananlar"
81+msgstr "Son aramalar"
80
82
81#: qml/Components/SeeMore.qml:35
83#: qml/Components/SeeMore.qml:35
82msgid "See more"
84msgid "See more"
83−msgstr ""
85+msgstr "Daha fazlası"
84
86
85#: qml/Components/SeeMore.qml:57
87#: qml/Components/SeeMore.qml:57
86msgid "See less"
88msgid "See less"
87−msgstr ""
89+msgstr "Daha azını gör"
88
90
89#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
91#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
90msgid "Rate this"
92msgid "Rate this"
@@ -106,11 +108,11 @@ msgstr[1] "%1 inceleme"
106
108
107#: qml/Dash/Previews/PreviewActionCombo.qml:34
109#: qml/Dash/Previews/PreviewActionCombo.qml:34
108msgid "More..."
110msgid "More..."
109−msgstr ""
111+msgstr "Daha fazlası..."
110
112
111#: qml/Dash/Previews/PreviewActionCombo.qml:34
113#: qml/Dash/Previews/PreviewActionCombo.qml:34
112msgid "Less..."
114msgid "Less..."
113−msgstr ""
115+msgstr "Daha az.."
114
116
115#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
117#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
116msgid "Add a review"
118msgid "Add a review"
@@ -167,7 +169,7 @@ msgstr "Parolayı göster"
167
169
168#: qml/Notifications/NotificationMenuItemFactory.qml:103
170#: qml/Notifications/NotificationMenuItemFactory.qml:103
169msgid "Please enter SIM PIN"
171msgid "Please enter SIM PIN"
170−msgstr ""
172+msgstr "Lütfen SIM PIN'inizi girin"
171
173
172#: qml/Panel/SearchIndicator.qml:27
174#: qml/Panel/SearchIndicator.qml:27
173msgid "Search"
175msgid "Search"
qml/Greeter/Greeter.qml+4
@@ -77,6 +77,10 @@ Showable {
77
77
78 source: required ? "GreeterContent.qml" : ""
78 source: required ? "GreeterContent.qml" : ""
79
79
80+ onLoaded: {
81+ selected(currentIndex);
82+ }
83+
80 Connections {
84 Connections {
81 target: greeterContentLoader.item
85 target: greeterContentLoader.item
82
86
qml/Greeter/GreeterContent.qml−1
@@ -60,7 +60,6 @@ MouseArea {
60
60
61 onLoaded: {
61 onLoaded: {
62 item.currentIndex = greeterContentLoader.currentIndex;
62 item.currentIndex = greeterContentLoader.currentIndex;
63− selected(item.currentIndex);
64 item.resetAuthentication();
63 item.resetAuthentication();
65 }
64 }
66
65
qml/GreeterShell.qml−2
@@ -66,7 +66,6 @@ BasicShell {
66 Component.onCompleted: {
66 Component.onCompleted: {
67 if (LightDM.Users.count == 1) {
67 if (LightDM.Users.count == 1) {
68 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
68 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
69− greeter.selected(0)
70 }
69 }
71 }
70 }
72 }
71 }
@@ -126,7 +125,6 @@ BasicShell {
126 // If there are more users, the Greeter will handle that
125 // If there are more users, the Greeter will handle that
127 if (LightDM.Users.count == 1) {
126 if (LightDM.Users.count == 1) {
128 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
127 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
129− greeter.selected(0);
130 }
128 }
131 greeter.forceActiveFocus();
129 greeter.forceActiveFocus();
132 }
130 }
qml/Panel/IndicatorItem.qml+13−21
@@ -19,37 +19,29 @@ import Ubuntu.Components 0.1
19import Unity.Indicators 0.1 as Indicators
19import Unity.Indicators 0.1 as Indicators
20import "../Components"
20import "../Components"
21
21
22−Item {
22+Loader {
23− id: indicatorItem
23+ id: root
24
24
25− property alias widgetSource: loader.source
25+ property alias widgetSource: root.source
26 property bool dimmed: false
26 property bool dimmed: false
27 property var indicatorProperties: undefined
27 property var indicatorProperties: undefined
28− property bool indicatorVisible: loader.item ? loader.item.enabled : false
28+ property bool indicatorVisible: item ? item.enabled : false
29 property string identifier
29 property string identifier
30
30
31 opacity: dimmed ? 0.4 : 1
31 opacity: dimmed ? 0.4 : 1
32 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
32 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
33
33
34− width: loader.item ? loader.item.width : 0
35−
36− Loader {
37− id: loader
38−
39− onLoaded: {
34+ onLoaded: {
40− item.height = Qt.binding(function() { return indicatorItem.height; });
41−
42− for(var pName in indicatorProperties) {
35+ for(var pName in indicatorProperties) {
43− if (item.hasOwnProperty(pName)) {
36+ if (item.hasOwnProperty(pName)) {
44− item[pName] = indicatorProperties[pName];
37+ item[pName] = indicatorProperties[pName];
45− }
46 }
38 }
47 }
39 }
40+ }
48
41
49− Binding {
42+ Binding {
50− target: loader.item
43+ target: item
51− property: "objectName"
44+ property: "objectName"
52− value: identifier + "-widget"
45+ value: identifier + "-widget"
53− }
54 }
46 }
55}
47}
tests/mocks/AccountsService/AccountsService.cpp+1−1
@@ -20,7 +20,7 @@
20
20
21AccountsService::AccountsService(QObject* parent)
21AccountsService::AccountsService(QObject* parent)
22 : QObject(parent),
22 : QObject(parent),
23− m_backgroundFile(TOP_SRCDIR "/graphics/phone_background.jpg"),
23+ m_backgroundFile(TOP_SRCDIR "/qml/graphics/phone_background.jpg"),
24 m_statsWelcomeScreen(true)
24 m_statsWelcomeScreen(true)
25{
25{
26}
26}
tests/mocks/Unity/Indicators/CMakeLists.txt+1
@@ -16,6 +16,7 @@ set(IndicatorsFakeQml_SOURCES
16 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/menucontentactivator.cpp
16 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/menucontentactivator.cpp
17 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/unitymenumodelstack.cpp
17 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/unitymenumodelstack.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/visibleindicatorsmodel.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/visibleindicatorsmodel.cpp
19+ fakeindicatorsmodel.cpp
19)
20)
20
21
21set(IndicatorsFakeQml_RESOURCES
22set(IndicatorsFakeQml_RESOURCES
tests/mocks/Unity/Indicators/IndicatorsModel.qml+3−5
@@ -17,12 +17,10 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Unity.Indicators 0.1 as Indicators
18import Unity.Indicators 0.1 as Indicators
19
19
20−ListModel {
20+Indicators.FakeIndicatorsModel {
21
21
22− property var indicatorData : undefined
23−
24− function load() {
22+ function load(profile) {
25− clear();
23+ unload();
26
24
27 append({ "identifier": "indicator-fake1",
25 append({ "identifier": "indicator-fake1",
28 "position": 0,
26 "position": 0,
tests/mocks/Unity/Indicators/fakeindicatorsmodel.cppnew file+116
@@ -0,0 +1,116 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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+ * Authors:
17+ * Nick Dedekind <nick.dedekind@canonical.com>
18+ */
19+
20+#include "fakeindicatorsmodel.h"
21+#include "indicators.h"
22+
23+FakeIndicatorsModel::FakeIndicatorsModel(QObject *parent)
24+ : QAbstractListModel(parent)
25+{
26+ QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
27+ QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
28+ QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
29+}
30+
31+/*! \internal */
32+FakeIndicatorsModel::~FakeIndicatorsModel()
33+{
34+ unload();
35+}
36+
37+int FakeIndicatorsModel::count() const
38+{
39+ return rowCount();
40+}
41+
42+void FakeIndicatorsModel::load(const QString&)
43+{
44+}
45+
46+void FakeIndicatorsModel::unload()
47+{
48+ beginResetModel();
49+
50+ qDeleteAll(m_indicators);
51+ m_indicators.clear();
52+
53+ endResetModel();
54+}
55+
56+
57+void FakeIndicatorsModel::append(const QVariantMap& row)
58+{
59+ Indicator* new_row = new QHash<int, QVariant>();
60+ for (auto iter = row.begin(); iter != row.end(); ++iter )
61+ {
62+ int key = roleNames().key(iter.key().toUtf8(), -1);
63+ if (key != -1) {
64+ new_row->insert(key, iter.value());
65+ }
66+ }
67+
68+ beginInsertRows(QModelIndex(), m_indicators.count(), m_indicators.count());
69+
70+ m_indicators.append(new_row);
71+
72+ endInsertRows();
73+}
74+
75+QHash<int, QByteArray> FakeIndicatorsModel::roleNames() const
76+{
77+ static QHash<int, QByteArray> roles;
78+ if (roles.isEmpty())
79+ {
80+ roles[IndicatorsModelRole::Identifier] = "identifier";
81+ roles[IndicatorsModelRole::Position] = "position";
82+ roles[IndicatorsModelRole::WidgetSource] = "widgetSource";
83+ roles[IndicatorsModelRole::PageSource] = "pageSource";
84+ roles[IndicatorsModelRole::IndicatorProperties] = "indicatorProperties";
85+ }
86+ return roles;
87+}
88+
89+int FakeIndicatorsModel::columnCount(const QModelIndex &) const
90+{
91+ return 1;
92+}
93+
94+Q_INVOKABLE QVariant FakeIndicatorsModel::data(int row, int role) const
95+{
96+ return data(index(row, 0), role);
97+}
98+
99+QVariant FakeIndicatorsModel::data(const QModelIndex &index, int role) const
100+{
101+ if (!index.isValid() || index.row() >= m_indicators.size())
102+ return QVariant();
103+
104+ Indicator* indicator = m_indicators[index.row()];
105+ return indicator->value(role, QVariant());
106+}
107+
108+QModelIndex FakeIndicatorsModel::parent(const QModelIndex&) const
109+{
110+ return QModelIndex();
111+}
112+
113+int FakeIndicatorsModel::rowCount(const QModelIndex&) const
114+{
115+ return m_indicators.count();
116+}
tests/mocks/Unity/Indicators/fakeindicatorsmodel.hnew file+59
@@ -0,0 +1,59 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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+ * Authors:
17+ * Nick Dedekind <nick.dedekind@canonical.com>
18+ */
19+
20+#ifndef FAKE_INDICATORSMODEL_H
21+#define FAKE_INDICATORSMODEL_H
22+
23+#include <QAbstractListModel>
24+
25+class FakeIndicatorsModel : public QAbstractListModel
26+{
27+ Q_OBJECT
28+ Q_ENUMS(Roles)
29+ Q_PROPERTY(int count READ count NOTIFY countChanged)
30+public:
31+
32+ FakeIndicatorsModel(QObject *parent=0);
33+ ~FakeIndicatorsModel();
34+
35+ Q_INVOKABLE void load(const QString& profile);
36+ Q_INVOKABLE void unload();
37+
38+ Q_INVOKABLE void append(const QVariantMap& row);
39+
40+ Q_INVOKABLE QVariant data(int row, int role) const;
41+
42+ /* QAbstractItemModel */
43+ QHash<int, QByteArray> roleNames() const;
44+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
45+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
46+ QModelIndex parent (const QModelIndex &index) const;
47+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
48+
49+Q_SIGNALS:
50+ void countChanged();
51+
52+private:
53+ int count() const;
54+
55+ typedef QHash<int, QVariant> Indicator;
56+ QList<Indicator*> m_indicators;
57+};
58+
59+#endif // FAKE_INDICATORSMODEL_H
tests/mocks/Unity/Indicators/fakeplugin.cpp+6
@@ -23,6 +23,7 @@
23#include "fakeplugin.h"
23#include "fakeplugin.h"
24
24
25// local
25// local
26+#include "fakeindicatorsmodel.h"
26#include "indicators.h"
27#include "indicators.h"
27#include "menucontentactivator.h"
28#include "menucontentactivator.h"
28#include "unitymenumodelstack.h"
29#include "unitymenumodelstack.h"
@@ -32,10 +33,15 @@ void IndicatorsFakePlugin::registerTypes(const char * uri)
32{
33{
33 Q_INIT_RESOURCE(indicators_fake);
34 Q_INIT_RESOURCE(indicators_fake);
34
35
36+ // internal
37+ qmlRegisterType<FakeIndicatorsModel>(uri, 0, 1, "FakeIndicatorsModel");
38+
39+ // external
35 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
40 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
36 qmlRegisterType<UnityMenuModelStack>(uri, 0, 1, "UnityMenuModelStack");
41 qmlRegisterType<UnityMenuModelStack>(uri, 0, 1, "UnityMenuModelStack");
37 qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel");
42 qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel");
38
43
44+ // external uncreatables
39 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
45 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
40 qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
46 qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
41 qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", "Can't create NetworkActionState class");
47 qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", "Can't create NetworkActionState class");
tests/qmltests/Greeter/tst_Phone.qml+19
@@ -44,6 +44,17 @@ Item {
44 }
44 }
45 }
45 }
46
46
47+ Component {
48+ id: greeterComponent
49+ Greeter {
50+ SignalSpy {
51+ objectName: "selectedSpy"
52+ target: parent
53+ signalName: "selected"
54+ }
55+ }
56+ }
57+
47 SignalSpy {
58 SignalSpy {
48 id: unlockSpy
59 id: unlockSpy
49 target: greeter
60 target: greeter
@@ -132,5 +143,13 @@ Item {
132 AccountsService.statsWelcomeScreen = true
143 AccountsService.statsWelcomeScreen = true
133 tryCompare(LightDM.Infographic, "username", "single")
144 tryCompare(LightDM.Infographic, "username", "single")
134 }
145 }
146+
147+ function test_initial_selected_signal() {
148+ var greeterObj = greeterComponent.createObject(this)
149+ var spy = findChild(greeterObj, "selectedSpy")
150+ spy.wait()
151+ tryCompare(spy, "count", 1)
152+ greeterObj.destroy()
153+ }
135 }
154 }
136}
155}
tests/qmltests/Greeter/tst_Tablet.qml+19
@@ -31,6 +31,17 @@ Item {
31 anchors.fill: parent
31 anchors.fill: parent
32 }
32 }
33
33
34+ Component {
35+ id: greeterComponent
36+ Greeter {
37+ SignalSpy {
38+ objectName: "selectedSpy"
39+ target: parent
40+ signalName: "selected"
41+ }
42+ }
43+ }
44+
34 SignalSpy {
45 SignalSpy {
35 id: unlockSpy
46 id: unlockSpy
36 target: greeter
47 target: greeter
@@ -335,5 +346,13 @@ Item {
335 var userlist = findChild(greeter, "userList")
346 var userlist = findChild(greeter, "userList")
336 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
347 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
337 }
348 }
349+
350+ function test_initial_selected_signal() {
351+ var greeterObj = greeterComponent.createObject(this)
352+ var spy = findChild(greeterObj, "selectedSpy")
353+ spy.wait()
354+ tryCompare(spy, "count", 1)
355+ greeterObj.destroy()
356+ }
338 }
357 }
339}
358}
tests/qmltests/Panel/tst_IndicatorRow.qml+3−3
@@ -70,13 +70,13 @@ Item {
70 function test_set_current_item() {
70 function test_set_current_item() {
71 init_test();
71 init_test();
72 indicatorRow.setCurrentItemIndex(0);
72 indicatorRow.setCurrentItemIndex(0);
73− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake1", "Incorrect item at position 0");
73+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake1", "Incorrect item at position 0");
74
74
75 indicatorRow.setCurrentItemIndex(1);
75 indicatorRow.setCurrentItemIndex(1);
76− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake2", "Incorrect item at position 1");
76+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake2", "Incorrect item at position 1");
77
77
78 indicatorRow.setCurrentItemIndex(2);
78 indicatorRow.setCurrentItemIndex(2);
79− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake3", "Incorrect item at position 2");
79+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake3", "Incorrect item at position 2");
80 }
80 }
81
81
82 function test_highlight_data() {
82 function test_highlight_data() {
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -133,7 +133,7 @@ Item {
133 var menuIndex = i%menuCount;
133 var menuIndex = i%menuCount;
134
134
135 activate_content(menuIndex);
135 activate_content(menuIndex);
136− testTabObjectName = indicatorsModel.get(menuIndex).identifier;
136+ testTabObjectName = indicatorsModel.data(menuIndex, Indicators.IndicatorsModelRole.Identifier);
137 compare(tabs.selectedTabIndex, menuIndex, "Current tab index does not match selected tab index");
137 compare(tabs.selectedTabIndex, menuIndex, "Current tab index does not match selected tab index");
138 tryCompareFunction(selected_tab_equals_test_tab, true);
138 tryCompareFunction(selected_tab_equals_test_tab, true);
139 }
139 }