on xenial help sign in
Merge from trunk
593dcb2Michael Terry
debian/changelog+18
@@ -4,6 +4,24 @@ unity8 (7.87+14.10.20140505-0ubuntu1) UNRELEASED; urgency=medium
4
4
5 -- Michael Terry <mterry@ubuntu.com> Wed, 02 Apr 2014 14:39:45 -0400
5 -- Michael Terry <mterry@ubuntu.com> Wed, 02 Apr 2014 14:39:45 -0400
6
6
7+unity8 (7.86+14.10.20140522-0ubuntu1) utopic; urgency=low
8+
9+ [ Albert Astals ]
10+ * Use Interface classes from unity-api
11+
12+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 22 May 2014 17:59:23 +0000
13+
14+unity8 (7.86+14.10.20140519-0ubuntu1) utopic; urgency=low
15+
16+ [ Ubuntu daily release ]
17+ * New rebuild forced
18+
19+ [ Albert Astals ]
20+ * Use the new displayMargin feature Also port our DashViews to use
21+ same naming and behaviour + update tests
22+
23+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 19 May 2014 07:35:51 +0000
24+
7unity8 (7.86+14.10.20140516.5-0ubuntu1) utopic; urgency=low
25unity8 (7.86+14.10.20140516.5-0ubuntu1) utopic; urgency=low
8
26
9 [ Michal Hruby ]
27 [ Michal Hruby ]
plugins/Dash/abstractdashview.cpp+18−48
@@ -23,10 +23,8 @@ AbstractDashView::AbstractDashView()
23 , m_asyncRequestedIndex(-1)
23 , m_asyncRequestedIndex(-1)
24 , m_columnSpacing(0)
24 , m_columnSpacing(0)
25 , m_rowSpacing(0)
25 , m_rowSpacing(0)
26− , m_delegateCreationBegin(0)
26+ , m_displayMarginBeginning(0)
27− , m_delegateCreationEnd(0)
27+ , m_displayMarginEnd(0)
28− , m_delegateCreationBeginValid(false)
29− , m_delegateCreationEndValid(false)
30 , m_needsRelayout(false)
28 , m_needsRelayout(false)
31 , m_delegateValidated(false)
29 , m_delegateValidated(false)
32 , m_implicitHeightDirty(false)
30 , m_implicitHeightDirty(false)
@@ -114,62 +112,36 @@ void AbstractDashView::setRowSpacing(qreal rowSpacing)
114 }
112 }
115}
113}
116
114
117−qreal AbstractDashView::delegateCreationBegin() const
115+qreal AbstractDashView::displayMarginBeginning() const
118{
116{
119− return m_delegateCreationBegin;
117+ return m_displayMarginBeginning;
120}
118}
121
119
122−void AbstractDashView::setDelegateCreationBegin(qreal begin)
120+void AbstractDashView::setDisplayMarginBeginning(qreal begin)
123{
121{
124− m_delegateCreationBeginValid = true;
122+ if (m_displayMarginBeginning == begin)
125− if (m_delegateCreationBegin == begin)
126 return;
123 return;
127− m_delegateCreationBegin = begin;
124+ m_displayMarginBeginning = begin;
128 if (isComponentComplete()) {
125 if (isComponentComplete()) {
129 polish();
126 polish();
130 }
127 }
131− emit delegateCreationBeginChanged();
128+ emit displayMarginBeginningChanged();
132}
129}
133
130
134−void AbstractDashView::resetDelegateCreationBegin()
131+qreal AbstractDashView::displayMarginEnd() const
135{
132{
136− m_delegateCreationBeginValid = false;
133+ return m_displayMarginEnd;
137− if (m_delegateCreationBegin == 0)
138− return;
139− m_delegateCreationBegin = 0;
140− if (isComponentComplete()) {
141− polish();
142− }
143− emit delegateCreationBeginChanged();
144−}
145−
146−qreal AbstractDashView::delegateCreationEnd() const
147−{
148− return m_delegateCreationEnd;
149−}
150−
151−void AbstractDashView::setDelegateCreationEnd(qreal end)
152−{
153− m_delegateCreationEndValid = true;
154− if (m_delegateCreationEnd == end)
155− return;
156− m_delegateCreationEnd = end;
157− if (isComponentComplete()) {
158− polish();
159− }
160− emit delegateCreationEndChanged();
161}
134}
162
135
163−void AbstractDashView::resetDelegateCreationEnd()
136+void AbstractDashView::setDisplayMarginEnd(qreal end)
164{
137{
165− m_delegateCreationEndValid = false;
138+ if (m_displayMarginEnd == end)
166− if (m_delegateCreationEnd == 0)
167 return;
139 return;
168− m_delegateCreationEnd = 0;
140+ m_displayMarginEnd = end;
169 if (isComponentComplete()) {
141 if (isComponentComplete()) {
170 polish();
142 polish();
171 }
143 }
172− emit delegateCreationEndChanged();
144+ emit displayMarginEndChanged();
173}
145}
174
146
175void AbstractDashView::createDelegateModel()
147void AbstractDashView::createDelegateModel()
@@ -186,9 +158,8 @@ void AbstractDashView::refill()
186 return;
158 return;
187 }
159 }
188
160
189− const bool delegateRangesValid = m_delegateCreationBeginValid && m_delegateCreationEndValid;
161+ const qreal from = -m_displayMarginBeginning;
190− const qreal from = delegateRangesValid ? m_delegateCreationBegin : 0;
162+ const qreal to = height() + m_displayMarginEnd;
191− const qreal to = delegateRangesValid ? m_delegateCreationEnd : from + height();
192 const qreal buffer = (to - from) * bufferRatio;
163 const qreal buffer = (to - from) * bufferRatio;
193 const qreal bufferFrom = from - buffer;
164 const qreal bufferFrom = from - buffer;
194 const qreal bufferTo = to + buffer;
165 const qreal bufferTo = to + buffer;
@@ -330,9 +301,8 @@ void AbstractDashView::updatePolish()
330
301
331 refill();
302 refill();
332
303
333− const bool delegateRangesValid = m_delegateCreationBeginValid && m_delegateCreationEndValid;
304+ const qreal from = -m_displayMarginBeginning;
334− const qreal from = delegateRangesValid ? m_delegateCreationBegin : 0;
305+ const qreal to = height() + m_displayMarginEnd;
335− const qreal to = delegateRangesValid ? m_delegateCreationEnd : from + height();
336 updateItemCulling(from, to);
306 updateItemCulling(from, to);
337
307
338 if (m_implicitHeightDirty) {
308 if (m_implicitHeightDirty) {
plugins/Dash/abstractdashview.h+14−20
@@ -35,14 +35,12 @@ class AbstractDashView : public QQuickItem
35 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
35 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
36 Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged)
36 Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged)
37 Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged)
37 Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged)
38− Q_PROPERTY(qreal delegateCreationBegin READ delegateCreationBegin
38+ Q_PROPERTY(qreal displayMarginBeginning READ displayMarginBeginning
39− WRITE setDelegateCreationBegin
39+ WRITE setDisplayMarginBeginning
40− NOTIFY delegateCreationBeginChanged
40+ NOTIFY displayMarginBeginningChanged)
41− RESET resetDelegateCreationBegin)
41+ Q_PROPERTY(qreal displayMarginEnd READ displayMarginEnd
42− Q_PROPERTY(qreal delegateCreationEnd READ delegateCreationEnd
42+ WRITE setDisplayMarginEnd
43− WRITE setDelegateCreationEnd
43+ NOTIFY displayMarginEndChanged)
44− NOTIFY delegateCreationEndChanged
45− RESET resetDelegateCreationEnd)
46
44
47friend class VerticalJournalTest;
45friend class VerticalJournalTest;
48friend class HorizontalJournalTest;
46friend class HorizontalJournalTest;
@@ -63,21 +61,19 @@ public:
63 qreal rowSpacing() const;
61 qreal rowSpacing() const;
64 void setRowSpacing(qreal rowSpacing);
62 void setRowSpacing(qreal rowSpacing);
65
63
66− qreal delegateCreationBegin() const;
64+ qreal displayMarginBeginning() const;
67− void setDelegateCreationBegin(qreal);
65+ void setDisplayMarginBeginning(qreal);
68− void resetDelegateCreationBegin();
69
66
70− qreal delegateCreationEnd() const;
67+ qreal displayMarginEnd() const;
71− void setDelegateCreationEnd(qreal);
68+ void setDisplayMarginEnd(qreal);
72− void resetDelegateCreationEnd();
73
69
74Q_SIGNALS:
70Q_SIGNALS:
75 void modelChanged();
71 void modelChanged();
76 void delegateChanged();
72 void delegateChanged();
77 void columnSpacingChanged();
73 void columnSpacingChanged();
78 void rowSpacingChanged();
74 void rowSpacingChanged();
79− void delegateCreationBeginChanged();
75+ void displayMarginBeginningChanged();
80− void delegateCreationEndChanged();
76+ void displayMarginEndChanged();
81
77
82protected Q_SLOTS:
78protected Q_SLOTS:
83 void relayout();
79 void relayout();
@@ -117,10 +113,8 @@ private:
117
113
118 int m_columnSpacing;
114 int m_columnSpacing;
119 int m_rowSpacing;
115 int m_rowSpacing;
120− qreal m_delegateCreationBegin;
116+ qreal m_displayMarginBeginning;
121− qreal m_delegateCreationEnd;
117+ qreal m_displayMarginEnd;
122− bool m_delegateCreationBeginValid;
123− bool m_delegateCreationEndValid;
124 bool m_needsRelayout;
118 bool m_needsRelayout;
125 bool m_delegateValidated;
119 bool m_delegateValidated;
126 bool m_implicitHeightDirty;
120 bool m_implicitHeightDirty;
po/ar.po+5−5
@@ -8,14 +8,14 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-02-21 11:19+0000\n"
11+"PO-Revision-Date: 2014-05-22 08:22+0000\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
13"Language-Team: Arabic <ar@li.org>\n"
13"Language-Team: Arabic <ar@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-23 09:13+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -89,7 +89,7 @@ msgstr "شاهد أقل"
89
89
90#: qml/Dash/DashApps.qml:37
90#: qml/Dash/DashApps.qml:37
91msgid "Recent"
91msgid "Recent"
92−msgstr ""
92+msgstr "استُخدمت مؤخرًا"
93
93
94#: qml/Dash/PreviewListView.qml:52
94#: qml/Dash/PreviewListView.qml:52
95#, qt-format
95#, qt-format
@@ -118,7 +118,7 @@ msgstr "أرسل"
118
118
119#: qml/Greeter/Greeter.qml:151
119#: qml/Greeter/Greeter.qml:151
120msgid "Swipe to unlock"
120msgid "Swipe to unlock"
121−msgstr ""
121+msgstr "اسحب لفتح القفل"
122
122
123#: qml/Greeter/Lockscreen.qml:149
123#: qml/Greeter/Lockscreen.qml:149
124msgid "Emergency Call"
124msgid "Emergency Call"
po/de.po+14−14
@@ -8,23 +8,23 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-01-15 11:01+0000\n"
11+"PO-Revision-Date: 2014-05-20 13:45+0000\n"
12−"Last-Translator: Dennis Baudys <Unknown>\n"
12+"Last-Translator: Tobias Bannert <Unknown>\n"
13"Language-Team: German <de@li.org>\n"
13"Language-Team: German <de@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
22msgid "Lock to Launcher"
22msgid "Lock to Launcher"
23−msgstr ""
23+msgstr "Im Starter sperren"
24
24
25#: plugins/Unity/Launcher/launcheritem.cpp:73
25#: plugins/Unity/Launcher/launcheritem.cpp:73
26msgid "Unlock from Launcher"
26msgid "Unlock from Launcher"
27−msgstr ""
27+msgstr "Aus dem Starter entsperren"
28
28
29#: qml/Components/EdgeDemoOverlay.qml:151
29#: qml/Components/EdgeDemoOverlay.qml:151
30msgid "Skip intro"
30msgid "Skip intro"
@@ -80,28 +80,28 @@ msgstr "Letzte Suchbegriffe"
80
80
81#: qml/Components/SeeMore.qml:35
81#: qml/Components/SeeMore.qml:35
82msgid "See more"
82msgid "See more"
83−msgstr ""
83+msgstr "Mehr ansehen"
84
84
85#: qml/Components/SeeMore.qml:58
85#: qml/Components/SeeMore.qml:58
86msgid "See less"
86msgid "See less"
87−msgstr ""
87+msgstr "Weniger ansehen"
88
88
89#: qml/Dash/DashApps.qml:37
89#: qml/Dash/DashApps.qml:37
90msgid "Recent"
90msgid "Recent"
91−msgstr ""
91+msgstr "Kürzlich"
92
92
93#: qml/Dash/PreviewListView.qml:52
93#: qml/Dash/PreviewListView.qml:52
94#, qt-format
94#, qt-format
95msgid "%1 Preview"
95msgid "%1 Preview"
96−msgstr ""
96+msgstr "%1 Vorschau"
97
97
98#: qml/Dash/Previews/PreviewActionCombo.qml:34
98#: qml/Dash/Previews/PreviewActionCombo.qml:34
99msgid "More..."
99msgid "More..."
100−msgstr ""
100+msgstr "Mehr …"
101
101
102#: qml/Dash/Previews/PreviewActionCombo.qml:34
102#: qml/Dash/Previews/PreviewActionCombo.qml:34
103msgid "Less..."
103msgid "Less..."
104−msgstr ""
104+msgstr "Weniger …"
105
105
106#: qml/Dash/Previews/PreviewRatingInput.qml:81
106#: qml/Dash/Previews/PreviewRatingInput.qml:81
107msgid "Rate this"
107msgid "Rate this"
@@ -117,7 +117,7 @@ msgstr "Senden"
117
117
118#: qml/Greeter/Greeter.qml:151
118#: qml/Greeter/Greeter.qml:151
119msgid "Swipe to unlock"
119msgid "Swipe to unlock"
120−msgstr ""
120+msgstr "Wischen zum Entsperren"
121
121
122#: qml/Greeter/Lockscreen.qml:149
122#: qml/Greeter/Lockscreen.qml:149
123msgid "Emergency Call"
123msgid "Emergency Call"
@@ -158,7 +158,7 @@ msgstr "Passwort anzeigen"
158
158
159#: qml/Notifications/NotificationMenuItemFactory.qml:103
159#: qml/Notifications/NotificationMenuItemFactory.qml:103
160msgid "Please enter SIM PIN"
160msgid "Please enter SIM PIN"
161−msgstr ""
161+msgstr "Bitte die PIN der SIM eingeben"
162
162
163#: qml/Panel/SearchIndicator.qml:27
163#: qml/Panel/SearchIndicator.qml:27
164msgid "Search"
164msgid "Search"
po/gd.po+16−14
@@ -8,23 +8,23 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2013-09-30 10:34+0000\n"
11+"PO-Revision-Date: 2014-05-17 21:08+0000\n"
12"Last-Translator: Akerbeltz <fios@akerbeltz.org>\n"
12"Last-Translator: Akerbeltz <fios@akerbeltz.org>\n"
13"Language-Team: Gaelic; Scottish <gd@li.org>\n"
13"Language-Team: Gaelic; Scottish <gd@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-18 05:57+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17007)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
22msgid "Lock to Launcher"
22msgid "Lock to Launcher"
23−msgstr ""
23+msgstr "Glais ris an lòinsear"
24
24
25#: plugins/Unity/Launcher/launcheritem.cpp:73
25#: plugins/Unity/Launcher/launcheritem.cpp:73
26msgid "Unlock from Launcher"
26msgid "Unlock from Launcher"
27−msgstr ""
27+msgstr "Dealaich on lòinsear"
28
28
29#: qml/Components/EdgeDemoOverlay.qml:151
29#: qml/Components/EdgeDemoOverlay.qml:151
30msgid "Skip intro"
30msgid "Skip intro"
@@ -77,6 +77,8 @@ msgid ""
77"You have now mastered the edge gestures and can start using the "
77"You have now mastered the edge gestures and can start using the "
78"phone<br><br>Tap on the screen to start"
78"phone<br><br>Tap on the screen to start"
79msgstr ""
79msgstr ""
80+"Fhuair thu air na gluasadan oire ceart a dhèanamh a-nis agus is urrainn dhut "
81+"am fòn a chleachdadh<br><br>Thoir gnogag air an sgrìn airson tòiseachadh"
80
82
81#: qml/Components/PageHeader.qml:365
83#: qml/Components/PageHeader.qml:365
82msgid "Recent searches"
84msgid "Recent searches"
@@ -84,28 +86,28 @@ msgstr "Na lorg thu o chionn goirid"
84
86
85#: qml/Components/SeeMore.qml:35
87#: qml/Components/SeeMore.qml:35
86msgid "See more"
88msgid "See more"
87−msgstr ""
89+msgstr "Seall barrachd"
88
90
89#: qml/Components/SeeMore.qml:58
91#: qml/Components/SeeMore.qml:58
90msgid "See less"
92msgid "See less"
91−msgstr ""
93+msgstr "Seall nas lugha"
92
94
93#: qml/Dash/DashApps.qml:37
95#: qml/Dash/DashApps.qml:37
94msgid "Recent"
96msgid "Recent"
95−msgstr ""
97+msgstr "O chionn goirid"
96
98
97#: qml/Dash/PreviewListView.qml:52
99#: qml/Dash/PreviewListView.qml:52
98#, qt-format
100#, qt-format
99msgid "%1 Preview"
101msgid "%1 Preview"
100−msgstr ""
102+msgstr "Ro-shealladh %1"
101
103
102#: qml/Dash/Previews/PreviewActionCombo.qml:34
104#: qml/Dash/Previews/PreviewActionCombo.qml:34
103msgid "More..."
105msgid "More..."
104−msgstr ""
106+msgstr "Barrachd..."
105
107
106#: qml/Dash/Previews/PreviewActionCombo.qml:34
108#: qml/Dash/Previews/PreviewActionCombo.qml:34
107msgid "Less..."
109msgid "Less..."
108−msgstr ""
110+msgstr "Nas lugha..."
109
111
110#: qml/Dash/Previews/PreviewRatingInput.qml:81
112#: qml/Dash/Previews/PreviewRatingInput.qml:81
111msgid "Rate this"
113msgid "Rate this"
@@ -121,7 +123,7 @@ msgstr "Cuir"
121
123
122#: qml/Greeter/Greeter.qml:151
124#: qml/Greeter/Greeter.qml:151
123msgid "Swipe to unlock"
125msgid "Swipe to unlock"
124−msgstr ""
126+msgstr "Dèan grad-shlaighdeadh gus a' ghlas a thoirt dheth"
125
127
126#: qml/Greeter/Lockscreen.qml:149
128#: qml/Greeter/Lockscreen.qml:149
127msgid "Emergency Call"
129msgid "Emergency Call"
@@ -158,11 +160,11 @@ msgstr "A' bruidhinn..."
158
160
159#: qml/Notifications/NotificationMenuItemFactory.qml:91
161#: qml/Notifications/NotificationMenuItemFactory.qml:91
160msgid "Show password"
162msgid "Show password"
161−msgstr ""
163+msgstr "Seall am facal-faire"
162
164
163#: qml/Notifications/NotificationMenuItemFactory.qml:103
165#: qml/Notifications/NotificationMenuItemFactory.qml:103
164msgid "Please enter SIM PIN"
166msgid "Please enter SIM PIN"
165−msgstr ""
167+msgstr "Cuir a-steach SIM PIN"
166
168
167#: qml/Panel/SearchIndicator.qml:27
169#: qml/Panel/SearchIndicator.qml:27
168msgid "Search"
170msgid "Search"
po/km.po+6−6
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-03-04 02:32+0000\n"
11+"PO-Revision-Date: 2014-05-19 01:42+0000\n"
12"Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n"
12"Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n"
13"Language-Team: Khmer <km@li.org>\n"
13"Language-Team: Khmer <km@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -90,12 +90,12 @@ msgstr "មើល​តិច​ជាង"
90
90
91#: qml/Dash/DashApps.qml:37
91#: qml/Dash/DashApps.qml:37
92msgid "Recent"
92msgid "Recent"
93−msgstr ""
93+msgstr "បច្ចុប្បន្ន"
94
94
95#: qml/Dash/PreviewListView.qml:52
95#: qml/Dash/PreviewListView.qml:52
96#, qt-format
96#, qt-format
97msgid "%1 Preview"
97msgid "%1 Preview"
98−msgstr ""
98+msgstr "មើល​ជា​មុន %1"
99
99
100#: qml/Dash/Previews/PreviewActionCombo.qml:34
100#: qml/Dash/Previews/PreviewActionCombo.qml:34
101msgid "More..."
101msgid "More..."
@@ -119,7 +119,7 @@ msgstr "ផ្ញើ"
119
119
120#: qml/Greeter/Greeter.qml:151
120#: qml/Greeter/Greeter.qml:151
121msgid "Swipe to unlock"
121msgid "Swipe to unlock"
122−msgstr ""
122+msgstr "អូស​ដើម្បី​ដោះសោ"
123
123
124#: qml/Greeter/Lockscreen.qml:149
124#: qml/Greeter/Lockscreen.qml:149
125msgid "Emergency Call"
125msgid "Emergency Call"
po/lt.po+9−9
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-01-15 12:42+0000\n"
11+"PO-Revision-Date: 2014-05-19 17:15+0000\n"
12−"Last-Translator: Gediminas Paulauskas <menesis@pov.lt>\n"
12+"Last-Translator: Mantas Kriaučiūnas <mantas@akl.lt>\n"
13"Language-Team: Lithuanian <lt@li.org>\n"
13"Language-Team: Lithuanian <lt@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−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -89,7 +89,7 @@ msgstr ""
89
89
90#: qml/Dash/DashApps.qml:37
90#: qml/Dash/DashApps.qml:37
91msgid "Recent"
91msgid "Recent"
92−msgstr ""
92+msgstr "Paskiausieji"
93
93
94#: qml/Dash/PreviewListView.qml:52
94#: qml/Dash/PreviewListView.qml:52
95#, qt-format
95#, qt-format
@@ -98,11 +98,11 @@ msgstr ""
98
98
99#: qml/Dash/Previews/PreviewActionCombo.qml:34
99#: qml/Dash/Previews/PreviewActionCombo.qml:34
100msgid "More..."
100msgid "More..."
101−msgstr ""
101+msgstr "Daugiau..."
102
102
103#: qml/Dash/Previews/PreviewActionCombo.qml:34
103#: qml/Dash/Previews/PreviewActionCombo.qml:34
104msgid "Less..."
104msgid "Less..."
105−msgstr ""
105+msgstr "Mažiau..."
106
106
107#: qml/Dash/Previews/PreviewRatingInput.qml:81
107#: qml/Dash/Previews/PreviewRatingInput.qml:81
108msgid "Rate this"
108msgid "Rate this"
@@ -118,7 +118,7 @@ msgstr "Siųsti"
118
118
119#: qml/Greeter/Greeter.qml:151
119#: qml/Greeter/Greeter.qml:151
120msgid "Swipe to unlock"
120msgid "Swipe to unlock"
121−msgstr ""
121+msgstr "Braukite ir atrakinsite"
122
122
123#: qml/Greeter/Lockscreen.qml:149
123#: qml/Greeter/Lockscreen.qml:149
124msgid "Emergency Call"
124msgid "Emergency Call"
@@ -159,7 +159,7 @@ msgstr "Rodyti slaptažodį"
159
159
160#: qml/Notifications/NotificationMenuItemFactory.qml:103
160#: qml/Notifications/NotificationMenuItemFactory.qml:103
161msgid "Please enter SIM PIN"
161msgid "Please enter SIM PIN"
162−msgstr ""
162+msgstr "Įveskite SIM kortelės PIN kodą"
163
163
164#: qml/Panel/SearchIndicator.qml:27
164#: qml/Panel/SearchIndicator.qml:27
165msgid "Search"
165msgid "Search"
po/nb.po+5−5
@@ -8,14 +8,14 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-05-15 17:12+0000\n"
11+"PO-Revision-Date: 2014-05-19 15:25+0000\n"
12−"Last-Translator: Åka Sikrom <Unknown>\n"
12+"Last-Translator: Thor Fjalestad <silvereyerocker@gmail.com>\n"
13"Language-Team: Norwegian Bokmal <nb@li.org>\n"
13"Language-Team: Norwegian Bokmal <nb@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−"X-Launchpad-Export-Date: 2014-05-16 06:52+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 17007)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -76,7 +76,7 @@ msgstr ""
76
76
77#: qml/Components/PageHeader.qml:365
77#: qml/Components/PageHeader.qml:365
78msgid "Recent searches"
78msgid "Recent searches"
79−msgstr "Siste søk"
79+msgstr "Nylige søk"
80
80
81#: qml/Components/SeeMore.qml:35
81#: qml/Components/SeeMore.qml:35
82msgid "See more"
82msgid "See more"
po/sl.po+6−6
@@ -8,14 +8,14 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-02-21 16:38+0000\n"
11+"PO-Revision-Date: 2014-05-22 14:07+0000\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
13"Language-Team: Slovenian <sl@li.org>\n"
13"Language-Team: Slovenian <sl@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−"X-Launchpad-Export-Date: 2014-05-01 06:44+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-23 09:13+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -90,12 +90,12 @@ msgstr "Pokaži manj"
90
90
91#: qml/Dash/DashApps.qml:37
91#: qml/Dash/DashApps.qml:37
92msgid "Recent"
92msgid "Recent"
93−msgstr ""
93+msgstr "Nedavno"
94
94
95#: qml/Dash/PreviewListView.qml:52
95#: qml/Dash/PreviewListView.qml:52
96#, qt-format
96#, qt-format
97msgid "%1 Preview"
97msgid "%1 Preview"
98−msgstr ""
98+msgstr "%1 predogled"
99
99
100#: qml/Dash/Previews/PreviewActionCombo.qml:34
100#: qml/Dash/Previews/PreviewActionCombo.qml:34
101msgid "More..."
101msgid "More..."
@@ -119,7 +119,7 @@ msgstr "Pošlji"
119
119
120#: qml/Greeter/Greeter.qml:151
120#: qml/Greeter/Greeter.qml:151
121msgid "Swipe to unlock"
121msgid "Swipe to unlock"
122−msgstr ""
122+msgstr "Podrsajte za odklenitev"
123
123
124#: qml/Greeter/Lockscreen.qml:149
124#: qml/Greeter/Lockscreen.qml:149
125msgid "Emergency Call"
125msgid "Emergency Call"
po/tr.po+7−7
@@ -8,14 +8,14 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-03-05 08:54+0000\n"
11+"PO-Revision-Date: 2014-05-19 12:52+0000\n"
12−"Last-Translator: Muhammed Yüce <muhammedyuceee@gmail.com>\n"
12+"Last-Translator: Volkan Gezer <Unknown>\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−"X-Launchpad-Export-Date: 2014-05-01 06:44+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -89,12 +89,12 @@ msgstr "Daha azını gör"
89
89
90#: qml/Dash/DashApps.qml:37
90#: qml/Dash/DashApps.qml:37
91msgid "Recent"
91msgid "Recent"
92−msgstr ""
92+msgstr "En son"
93
93
94#: qml/Dash/PreviewListView.qml:52
94#: qml/Dash/PreviewListView.qml:52
95#, qt-format
95#, qt-format
96msgid "%1 Preview"
96msgid "%1 Preview"
97−msgstr ""
97+msgstr "%1 Önizlemesi"
98
98
99#: qml/Dash/Previews/PreviewActionCombo.qml:34
99#: qml/Dash/Previews/PreviewActionCombo.qml:34
100msgid "More..."
100msgid "More..."
@@ -118,7 +118,7 @@ msgstr "Gönder"
118
118
119#: qml/Greeter/Greeter.qml:151
119#: qml/Greeter/Greeter.qml:151
120msgid "Swipe to unlock"
120msgid "Swipe to unlock"
121−msgstr ""
121+msgstr "Açmak için kaydırın"
122
122
123#: qml/Greeter/Lockscreen.qml:149
123#: qml/Greeter/Lockscreen.qml:149
124msgid "Emergency Call"
124msgid "Emergency Call"
po/zh_CN.po+15−15
@@ -8,23 +8,23 @@ 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-04-10 11:13-0400\n"
10"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-05-16 04:13+0000\n"
11+"PO-Revision-Date: 2014-05-19 02:24+0000\n"
12"Last-Translator: Shuduo Sang <Unknown>\n"
12"Last-Translator: Shuduo Sang <Unknown>\n"
13"Language-Team: Chinese (Simplified) <zh_CN@li.org>\n"
13"Language-Team: Chinese (Simplified) <zh_CN@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−"X-Launchpad-Export-Date: 2014-05-17 07:15+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
18−"X-Generator: Launchpad (build 17007)\n"
18+"X-Generator: Launchpad (build 17017)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
22msgid "Lock to Launcher"
22msgid "Lock to Launcher"
23−msgstr ""
23+msgstr "固定到启动器"
24
24
25#: plugins/Unity/Launcher/launcheritem.cpp:73
25#: plugins/Unity/Launcher/launcheritem.cpp:73
26msgid "Unlock from Launcher"
26msgid "Unlock from Launcher"
27−msgstr ""
27+msgstr "从启动器移除"
28
28
29#: qml/Components/EdgeDemoOverlay.qml:151
29#: qml/Components/EdgeDemoOverlay.qml:151
30msgid "Skip intro"
30msgid "Skip intro"
@@ -32,7 +32,7 @@ msgstr "跳过简介"
32
32
33#: qml/Components/EdgeDemo.qml:113
33#: qml/Components/EdgeDemo.qml:113
34msgid "Right edge"
34msgid "Right edge"
35−msgstr ""
35+msgstr "右边缘"
36
36
37#: qml/Components/EdgeDemo.qml:114
37#: qml/Components/EdgeDemo.qml:114
38msgid "Try swiping from the right edge to unlock the phone"
38msgid "Try swiping from the right edge to unlock the phone"
@@ -40,11 +40,11 @@ msgstr "从右边滑动可以解锁"
40
40
41#: qml/Components/EdgeDemo.qml:145
41#: qml/Components/EdgeDemo.qml:145
42msgid "Top edge"
42msgid "Top edge"
43−msgstr ""
43+msgstr "上边缘"
44
44
45#: qml/Components/EdgeDemo.qml:146
45#: qml/Components/EdgeDemo.qml:146
46msgid "Try swiping from the top edge to access the indicators"
46msgid "Try swiping from the top edge to access the indicators"
47−msgstr ""
47+msgstr "从上边缘划入可以访问指示器"
48
48
49#: qml/Components/EdgeDemo.qml:171
49#: qml/Components/EdgeDemo.qml:171
50msgid "Close"
50msgid "Close"
@@ -52,25 +52,25 @@ msgstr "关闭"
52
52
53#: qml/Components/EdgeDemo.qml:172
53#: qml/Components/EdgeDemo.qml:172
54msgid "Swipe up again to close the settings screen"
54msgid "Swipe up again to close the settings screen"
55−msgstr ""
55+msgstr "再次向上划动可以关闭设置界面"
56
56
57#: qml/Components/EdgeDemo.qml:199
57#: qml/Components/EdgeDemo.qml:199
58msgid "Left edge"
58msgid "Left edge"
59−msgstr ""
59+msgstr "左边缘"
60
60
61#: qml/Components/EdgeDemo.qml:200
61#: qml/Components/EdgeDemo.qml:200
62msgid "Swipe from the left to reveal the launcher for quick access to apps"
62msgid "Swipe from the left to reveal the launcher for quick access to apps"
63−msgstr ""
63+msgstr "从左边划入展开启动器可以快速打开应用"
64
64
65#: qml/Components/EdgeDemo.qml:227
65#: qml/Components/EdgeDemo.qml:227
66msgid "Well done"
66msgid "Well done"
67−msgstr ""
67+msgstr "做得好"
68
68
69#: qml/Components/EdgeDemo.qml:228
69#: qml/Components/EdgeDemo.qml:228
70msgid ""
70msgid ""
71"You have now mastered the edge gestures and can start using the "
71"You have now mastered the edge gestures and can start using the "
72"phone<br><br>Tap on the screen to start"
72"phone<br><br>Tap on the screen to start"
73−msgstr ""
73+msgstr "您现在已经掌握了边缘滑动手势,可以开始使用手机了<br><br>请点击屏幕开始使用"
74
74
75#: qml/Components/PageHeader.qml:365
75#: qml/Components/PageHeader.qml:365
76msgid "Recent searches"
76msgid "Recent searches"
@@ -78,7 +78,7 @@ msgstr "近期搜索"
78
78
79#: qml/Components/SeeMore.qml:35
79#: qml/Components/SeeMore.qml:35
80msgid "See more"
80msgid "See more"
81−msgstr ""
81+msgstr "了解更多"
82
82
83#: qml/Components/SeeMore.qml:58
83#: qml/Components/SeeMore.qml:58
84msgid "See less"
84msgid "See less"
@@ -86,7 +86,7 @@ msgstr "显示更少"
86
86
87#: qml/Dash/DashApps.qml:37
87#: qml/Dash/DashApps.qml:37
88msgid "Recent"
88msgid "Recent"
89−msgstr ""
89+msgstr "最近使用过的"
90
90
91#: qml/Dash/PreviewListView.qml:52
91#: qml/Dash/PreviewListView.qml:52
92#, qt-format
92#, qt-format
qml/Components/FilterGrid.qml+2−2
@@ -52,8 +52,8 @@ Item {
52 property alias delegate: iconTileGrid.delegate
52 property alias delegate: iconTileGrid.delegate
53 property alias cellWidth: iconTileGrid.cellWidth
53 property alias cellWidth: iconTileGrid.cellWidth
54 property alias cellHeight: iconTileGrid.cellHeight
54 property alias cellHeight: iconTileGrid.cellHeight
55− property alias delegateCreationBegin: iconTileGrid.delegateCreationBegin
55+ property alias displayMarginBeginning: iconTileGrid.displayMarginBeginning
56− property alias delegateCreationEnd: iconTileGrid.delegateCreationEnd
56+ property alias displayMarginEnd: iconTileGrid.displayMarginEnd
57 readonly property alias originY: iconTileGrid.originY
57 readonly property alias originY: iconTileGrid.originY
58 readonly property alias flicking: iconTileGrid.flicking
58 readonly property alias flicking: iconTileGrid.flicking
59 readonly property alias moving: iconTileGrid.moving
59 readonly property alias moving: iconTileGrid.moving
qml/Components/PageHeader.qml+1−1
@@ -26,7 +26,7 @@ Item {
26 property bool searchEntryEnabled: false
26 property bool searchEntryEnabled: false
27 property alias searchQuery: searchField.text
27 property alias searchQuery: searchField.text
28 property ListModel searchHistory
28 property ListModel searchHistory
29− property Scope scope
29+ property var scope: null
30 property alias childItem: itemContainer.children
30 property alias childItem: itemContainer.children
31 property alias showBackButton: backButton.visible
31 property alias showBackButton: backButton.visible
32
32
qml/Components/ResponsiveGridView.qml+3−3
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.0
17+import QtQuick 2.3
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19
19
20/*
20/*
@@ -41,8 +41,8 @@ Item {
41 readonly property alias moving: gridView.moving
41 readonly property alias moving: gridView.moving
42 readonly property alias pressDelay: gridView.pressDelay
42 readonly property alias pressDelay: gridView.pressDelay
43 readonly property alias originY: gridView.originY
43 readonly property alias originY: gridView.originY
44− property alias delegateCreationBegin: gridView.delegateCreationBegin
44+ property alias displayMarginBeginning: gridView.displayMarginBeginning
45− property alias delegateCreationEnd: gridView.delegateCreationEnd
45+ property alias displayMarginEnd: gridView.displayMarginEnd
46 property alias highlightIndex: gridView.highlightIndex
46 property alias highlightIndex: gridView.highlightIndex
47 readonly property alias currentItem: gridView.currentItem
47 readonly property alias currentItem: gridView.currentItem
48
48
qml/Dash/CardCarousel.qml+2−2
@@ -42,8 +42,8 @@ DashRenderer {
42 cacheBuffer: 1404 // 18px * 13gu * 6
42 cacheBuffer: 1404 // 18px * 13gu * 6
43 model: cardCarousel.model
43 model: cardCarousel.model
44
44
45− onClicked: cardCarousel.clicked(index, itemY)
45+ onClicked: cardCarousel.clicked(index, null)
46− onPressAndHold: cardCarousel.pressAndHold(index, itemY)
46+ onPressAndHold: cardCarousel.pressAndHold(index)
47
47
48 property real fontScale: 1 / selectedItemScaleFactor
48 property real fontScale: 1 / selectedItemScaleFactor
49 property real headerHeight: cardTool.headerHeight / selectedItemScaleFactor
49 property real headerHeight: cardTool.headerHeight / selectedItemScaleFactor
qml/Dash/CardFilterGrid.qml+4−4
@@ -43,8 +43,8 @@ DashRenderer {
43 verticalSpacing: genericFilterGrid.verticalSpacing
43 verticalSpacing: genericFilterGrid.verticalSpacing
44 model: genericFilterGrid.model
44 model: genericFilterGrid.model
45 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
45 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
46− delegateCreationBegin: genericFilterGrid.delegateCreationBegin
46+ displayMarginBeginning: genericFilterGrid.displayMarginBeginning
47− delegateCreationEnd: genericFilterGrid.delegateCreationEnd
47+ displayMarginEnd: genericFilterGrid.displayMarginEnd
48 delegate: Item {
48 delegate: Item {
49 width: filterGrid.cellWidth
49 width: filterGrid.cellWidth
50 height: filterGrid.cellHeight
50 height: filterGrid.cellHeight
@@ -64,8 +64,8 @@ DashRenderer {
64 }
64 }
65 Connections {
65 Connections {
66 target: loader.item
66 target: loader.item
67− onClicked: genericFilterGrid.clicked(index, item.y)
67+ onClicked: genericFilterGrid.clicked(index, result)
68− onPressAndHold: genericFilterGrid.pressAndHold(index, item.y)
68+ onPressAndHold: genericFilterGrid.pressAndHold(index)
69 }
69 }
70 }
70 }
71 }
71 }
qml/Dash/DashContent.qml+1−1
@@ -138,7 +138,7 @@ Item {
138
138
139 readonly property bool moving: item ? item.moving : false
139 readonly property bool moving: item ? item.moving : false
140 readonly property var categoryView: item ? item.categoryView : null
140 readonly property var categoryView: item ? item.categoryView : null
141− readonly property Scope theScope: scope
141+ readonly property var theScope: scope
142
142
143 // these are needed for autopilot tests
143 // these are needed for autopilot tests
144 readonly property string scopeId: scope.id
144 readonly property string scopeId: scope.id
qml/Dash/DashRenderer.qml+5−6
@@ -29,9 +29,9 @@ Item {
29
29
30 property int uncollapsedHeight: height
30 property int uncollapsedHeight: height
31
31
32− property var delegateCreationBegin: undefined
32+ property int displayMarginBeginning: 0
33
33
34− property var delegateCreationEnd: undefined
34+ property int displayMarginEnd: 0
35
35
36 property real originY: 0
36 property real originY: 0
37
37
@@ -50,13 +50,12 @@ Item {
50
50
51 /// Emitted when the user clicked on an item
51 /// Emitted when the user clicked on an item
52 /// @param index is the index of the clicked item
52 /// @param index is the index of the clicked item
53− /// @param itemY is y of the clicked delegate
53+ /// @param result result model of the cliked item, used for activation
54− signal clicked(int index, real itemY)
54+ signal clicked(int index, var result)
55
55
56 /// Emitted when the user pressed and held on an item
56 /// Emitted when the user pressed and held on an item
57 /// @param index is the index of the held item
57 /// @param index is the index of the held item
58− /// @param itemY is y of the held delegate
59− signal pressAndHold(int index, real itemY)
58+ signal pressAndHold(int index)
60
59
61 function setFilter(filter, animate) {
60 function setFilter(filter, animate) {
62 }
61 }
qml/Dash/GenericScopeView.qml+11−10
@@ -25,7 +25,7 @@ import "../Components/ListItems" as ListItems
25FocusScope {
25FocusScope {
26 id: scopeView
26 id: scopeView
27
27
28− property Scope scope: null
28+ property var scope: null
29 property SortFilterProxyModel categories: categoryFilter
29 property SortFilterProxyModel categories: categoryFilter
30 property bool isCurrent: false
30 property bool isCurrent: false
31 property alias moving: categoryView.moving
31 property alias moving: categoryView.moving
@@ -187,8 +187,7 @@ FocusScope {
187 // TODO Technically it is possible that calling activate() will make the scope emit
187 // TODO Technically it is possible that calling activate() will make the scope emit
188 // previewRequested so that we show a preview but there's no scope that does that yet
188 // previewRequested so that we show a preview but there's no scope that does that yet
189 // so it's not implemented
189 // so it's not implemented
190− var item = target.model.get(index);
191− scopeView.scope.activate(item.result)
190+ scopeView.scope.activate(result)
192 } else {
191 } else {
193 previewListView.model = target.model;
192 previewListView.model = target.model;
194 previewListView.currentIndex = -1
193 previewListView.currentIndex = -1
@@ -244,18 +243,20 @@ FocusScope {
244 }
243 }
245 }
244 }
246
245
247− if (item && item.hasOwnProperty("delegateCreationBegin")) {
246+ if (item && item.hasOwnProperty("displayMarginBeginning")) {
247+ // TODO do we need item.originY here, test 1300302 once we have a silo
248+ // and we can run it on the phone
248 if (baseItem.y + baseItem.height <= 0) {
249 if (baseItem.y + baseItem.height <= 0) {
249 // Not visible (item at top of the list viewport)
250 // Not visible (item at top of the list viewport)
250− item.delegateCreationBegin = item.originY + baseItem.height
251+ item.displayMarginBeginning = -baseItem.height;
251− item.delegateCreationEnd = item.originY + baseItem.height
252+ item.displayMarginEnd = 0;
252 } else if (baseItem.y >= categoryView.height) {
253 } else if (baseItem.y >= categoryView.height) {
253 // Not visible (item at bottom of the list viewport)
254 // Not visible (item at bottom of the list viewport)
254− item.delegateCreationBegin = item.originY
255+ item.displayMarginBeginning = 0;
255− item.delegateCreationEnd = item.originY
256+ item.displayMarginEnd = -baseItem.height;
256 } else {
257 } else {
257− item.delegateCreationBegin = item.originY + Math.max(-baseItem.y, 0)
258+ item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
258− item.delegateCreationEnd = item.originY + Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)
259+ item.displayMarginEnd = -Math.max(baseItem.height - categoryView.height + baseItem.y, 0)
259 }
260 }
260 }
261 }
261 }
262 }
qml/Dash/PreviewListView.qml+2−2
@@ -23,7 +23,7 @@ import "Previews" as Previews
23Item {
23Item {
24 id: root
24 id: root
25
25
26− property Scope scope: null
26+ property var scope: null
27 property var pageHeader: null
27 property var pageHeader: null
28
28
29 property alias open: previewListView.open
29 property alias open: previewListView.open
@@ -116,7 +116,7 @@ Item {
116
116
117 previewModel: {
117 previewModel: {
118 var previewStack = root.scope.preview(result);
118 var previewStack = root.scope.preview(result);
119− return previewStack.get(0);
119+ return previewStack.getPreviewModel(0);
120 }
120 }
121 }
121 }
122
122
qml/ScopeTool.qml+1−1
@@ -74,7 +74,7 @@ Rectangle {
74
74
75 model: filteredScopes
75 model: filteredScopes
76 searchHistory: SearchHistoryModel { }
76 searchHistory: SearchHistoryModel { }
77− property Scope scope: scopes.get(currentIndex)
77+ property var scope: scopes.getScope(currentIndex)
78
78
79 anchors {
79 anchors {
80 top: parent.top
80 top: parent.top
tests/mocks/Unity/CMakeLists.txt+8
@@ -6,6 +6,7 @@ add_subdirectory(Notifications)
6pkg_search_module(DEE dee-1.0 REQUIRED)
6pkg_search_module(DEE dee-1.0 REQUIRED)
7pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
7pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
8pkg_search_module(DEEQT libdee-qt5 REQUIRED)
8pkg_search_module(DEEQT libdee-qt5 REQUIRED)
9+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=1)
9
10
10include_directories(
11include_directories(
11 ${CMAKE_CURRENT_BINARY_DIR}
12 ${CMAKE_CURRENT_BINARY_DIR}
@@ -27,6 +28,13 @@ set(UnityQML_SOURCES
27 fake_previewstack.cpp
28 fake_previewstack.cpp
28 fake_previewwidgetmodel.cpp
29 fake_previewwidgetmodel.cpp
29 fake_unity_plugin.cpp
30 fake_unity_plugin.cpp
31+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h
32+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h
33+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h
34+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h
35+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/ResultsModelInterface.h
36+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/ScopeInterface.h
37+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/ScopesInterface.h
30)
38)
31
39
32add_library(FakeUnityQml MODULE ${UnityQML_SOURCES})
40add_library(FakeUnityQml MODULE ${UnityQML_SOURCES})
tests/mocks/Unity/fake_categories.cpp+6−22
@@ -22,24 +22,9 @@
22#include "fake_resultsmodel.h"
22#include "fake_resultsmodel.h"
23
23
24Categories::Categories(int category_count, QObject* parent)
24Categories::Categories(int category_count, QObject* parent)
25− : QAbstractListModel(parent)
25+ : unity::shell::scopes::CategoriesInterface(parent)
26 , m_category_count(category_count)
26 , m_category_count(category_count)
27{
27{
28− m_roles[Categories::RoleCategoryId] = "categoryId";
29− m_roles[Categories::RoleName] = "name";
30− m_roles[Categories::RoleIcon] = "icon";
31− m_roles[Categories::RoleRawRendererTemplate] = "rawRendererTemplate";
32− m_roles[Categories::RoleRenderer] = "renderer";
33− m_roles[Categories::RoleComponents] = "components";
34− m_roles[Categories::RoleProgressSource] = "progressSource";
35− m_roles[Categories::RoleResults] = "results";
36− m_roles[Categories::RoleCount] = "count";
37−}
38−
39−QHash<int, QByteArray>
40−Categories::roleNames() const
41−{
42− return m_roles;
43}
28}
44
29
45int Categories::rowCount(const QModelIndex& /*parent*/) const
30int Categories::rowCount(const QModelIndex& /*parent*/) const
@@ -65,6 +50,11 @@ void Categories::addSpecialCategory(QString const& categoryId, QString const& na
65 }
50 }
66}
51}
67
52
53+bool Categories::overrideCategoryJson(QString const& categoryId, QString const& json)
54+{
55+ qFatal("Using un-implemented Categories::overrideCategoryJson");
56+}
57+
68void Categories::countChanged()
58void Categories::countChanged()
69{
59{
70 QObject* countObject = sender();
60 QObject* countObject = sender();
@@ -126,9 +116,6 @@ Categories::data(const QModelIndex& index, int role) const
126 map["title"] = "HOLA";
116 map["title"] = "HOLA";
127 return map;
117 return map;
128 }
118 }
129− case RoleProgressSource:
130− qFatal("Using un-implemented RoleProgressSource Categories role");
131− return QVariant();
132 case RoleResults:
119 case RoleResults:
133 return QVariant();
120 return QVariant();
134 case RoleCount:
121 case RoleCount:
@@ -172,9 +159,6 @@ Categories::data(const QModelIndex& index, int role) const
172 map["subtitle"] = "HOLA";
159 map["subtitle"] = "HOLA";
173 return map;
160 return map;
174 }
161 }
175− case RoleProgressSource:
176− qFatal("Using un-implemented RoleProgressSource Categories role");
177− return QVariant();
178 case RoleResults:
162 case RoleResults:
179 return QVariant::fromValue(resultsModel);
163 return QVariant::fromValue(resultsModel);
180 case RoleCount:
164 case RoleCount:
tests/mocks/Unity/fake_categories.h+5−18
@@ -17,44 +17,31 @@
17#ifndef FAKE_CATEGORIES_H
17#ifndef FAKE_CATEGORIES_H
18#define FAKE_CATEGORIES_H
18#define FAKE_CATEGORIES_H
19
19
20+#include <unity/shell/scopes/CategoriesInterface.h>
21+
20// Qt
22// Qt
21−#include <QAbstractListModel>
22#include <QList>
23#include <QList>
23
24
24class ResultsModel;
25class ResultsModel;
25
26
26−class Categories : public QAbstractListModel
27+class Categories : public unity::shell::scopes::CategoriesInterface
27{
28{
28 Q_OBJECT
29 Q_OBJECT
29
30
30− Q_ENUMS(Roles)
31−
32public:
31public:
33 Categories(int category_count, QObject* parent = 0);
32 Categories(int category_count, QObject* parent = 0);
34− enum Roles {
35− RoleCategoryId,
36− RoleName,
37− RoleIcon,
38− RoleRawRendererTemplate,
39− RoleRenderer,
40− RoleComponents,
41− RoleProgressSource, // maybe
42− RoleResults,
43− RoleCount
44− };
45
33
46 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
34 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
47− QHash<int, QByteArray> roleNames() const override;
48 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
35 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
49
36
50− Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject);
37+ Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override;
38+ Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
51
39
52private Q_SLOTS:
40private Q_SLOTS:
53 void countChanged();
41 void countChanged();
54
42
55private:
43private:
56 mutable QHash<int, ResultsModel*> m_resultsModels;
44 mutable QHash<int, ResultsModel*> m_resultsModels;
57− QHash<int, QByteArray> m_roles;
58 int m_category_count;
45 int m_category_count;
59
46
60 struct CategoryData {
47 struct CategoryData {
tests/mocks/Unity/fake_previewmodel.cpp+2−15
@@ -27,22 +27,14 @@
27// Qt
27// Qt
28#include <QDebug>
28#include <QDebug>
29
29
30−PreviewModel::PreviewModel(QObject* parent) : QAbstractListModel(parent)
30+PreviewModel::PreviewModel(QObject* parent)
31+ : unity::shell::scopes::PreviewModelInterface(parent)
31{
32{
32 // we have one column by default
33 // we have one column by default
33 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
34 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
34 m_previewWidgetModels.append(columnModel);
35 m_previewWidgetModels.append(columnModel);
35}
36}
36
37
37−QHash<int, QByteArray> PreviewModel::roleNames() const
38−{
39− QHash<int, QByteArray> roles;
40−
41− roles[Roles::RoleColumnModel] = "columnModel";
42−
43− return roles;
44−}
45−
46void PreviewModel::setWidgetColumnCount(int count)
38void PreviewModel::setWidgetColumnCount(int count)
47{
39{
48 if (count != 1) {
40 if (count != 1) {
@@ -65,11 +57,6 @@ bool PreviewModel::processingAction() const
65 return false;
57 return false;
66}
58}
67
59
68−void PreviewModel::setProcessingAction(bool /*processing*/)
69−{
70− qFatal("PreviewModel::setProcessingAction not implemented");
71−}
72−
73int PreviewModel::rowCount(const QModelIndex&) const
60int PreviewModel::rowCount(const QModelIndex&) const
74{
61{
75 return m_previewWidgetModels.size();
62 return m_previewWidgetModels.size();
tests/mocks/Unity/fake_previewmodel.h+7−25
@@ -18,47 +18,29 @@
18#ifndef FAKE_PREVIEWMODEL_H
18#ifndef FAKE_PREVIEWMODEL_H
19#define FAKE_PREVIEWMODEL_H
19#define FAKE_PREVIEWMODEL_H
20
20
21−#include <QAbstractListModel>
21+#include <unity/shell/scopes/PreviewModelInterface.h>
22+
22#include <QSharedPointer>
23#include <QSharedPointer>
23#include <QVariantMap>
24#include <QVariantMap>
24
25
25class PreviewWidgetModel;
26class PreviewWidgetModel;
26
27
27−class PreviewModel : public QAbstractListModel
28+class PreviewModel : public unity::shell::scopes::PreviewModelInterface
28{
29{
29 Q_OBJECT
30 Q_OBJECT
30
31
31− Q_ENUMS(Roles)
32−
33− Q_PROPERTY(int widgetColumnCount READ widgetColumnCount WRITE setWidgetColumnCount NOTIFY widgetColumnCountChanged)
34− Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged)
35− Q_PROPERTY(bool processingAction READ processingAction NOTIFY processingActionChanged)
36−
37public:
32public:
38 explicit PreviewModel(QObject* parent = 0);
33 explicit PreviewModel(QObject* parent = 0);
39
34
40− enum Roles {
41− RoleColumnModel
42− };
43−
44 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
35 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
45− QHash<int, QByteArray> roleNames() const override;
46 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
36 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
47
37
48− void setWidgetColumnCount(int count);
38+ void setWidgetColumnCount(int count) override;
49− int widgetColumnCount() const;
39+ int widgetColumnCount() const override;
50− bool loaded() const;
40+ bool loaded() const override;
51− bool processingAction() const;
41+ bool processingAction() const override;
52− void setProcessingAction(bool processing);
53−
54−Q_SIGNALS:
55− void widgetColumnCountChanged();
56− void loadedChanged();
57− void processingActionChanged();
58− void triggered(QString const&, QString const&, QVariantMap const&);
59
42
60private:
43private:
61− QHash<int, QByteArray> m_roles;
62 QList<PreviewWidgetModel*> m_previewWidgetModels;
44 QList<PreviewWidgetModel*> m_previewWidgetModels;
63};
45};
64
46
tests/mocks/Unity/fake_previewstack.cpp+3−11
@@ -21,7 +21,8 @@
21#include "fake_previewmodel.h"
21#include "fake_previewmodel.h"
22#include "fake_scope.h"
22#include "fake_scope.h"
23
23
24−PreviewStack::PreviewStack(QObject* parent) : QAbstractListModel(parent)
24+PreviewStack::PreviewStack(QObject* parent)
25+ : unity::shell::scopes::PreviewStackInterface(parent)
25{
26{
26 m_previews << new PreviewModel(this);
27 m_previews << new PreviewModel(this);
27}
28}
@@ -30,15 +31,6 @@ PreviewStack::~PreviewStack()
30{
31{
31}
32}
32
33
33−QHash<int, QByteArray> PreviewStack::roleNames() const
34−{
35− QHash<int, QByteArray> roles;
36−
37− roles[Roles::RolePreviewModel] = "previewModel";
38−
39− return roles;
40−}
41−
42void PreviewStack::setWidgetColumnCount(int columnCount)
34void PreviewStack::setWidgetColumnCount(int columnCount)
43{
35{
44 if (columnCount != 1) {
36 if (columnCount != 1) {
@@ -56,7 +48,7 @@ int PreviewStack::rowCount(const QModelIndex&) const
56 return m_previews.size();
48 return m_previews.size();
57}
49}
58
50
59−PreviewModel* PreviewStack::get(int index) const
51+unity::shell::scopes::PreviewModelInterface* PreviewStack::getPreviewModel(int index) const
60{
52{
61 if (index >= m_previews.size()) {
53 if (index >= m_previews.size()) {
62 return nullptr;
54 return nullptr;
tests/mocks/Unity/fake_previewstack.h+6−17
@@ -18,39 +18,28 @@
18#ifndef FAKE_PREVIEWSTACK_H
18#ifndef FAKE_PREVIEWSTACK_H
19#define FAKE_PREVIEWSTACK_H
19#define FAKE_PREVIEWSTACK_H
20
20
21−#include <QAbstractListModel>
21+#include <unity/shell/scopes/PreviewStackInterface.h>
22+
22#include <QSharedPointer>
23#include <QSharedPointer>
23#include <QVariantMap>
24#include <QVariantMap>
24
25
25class PreviewModel;
26class PreviewModel;
26
27
27−class PreviewStack : public QAbstractListModel
28+class PreviewStack : public unity::shell::scopes::PreviewStackInterface
28{
29{
29 Q_OBJECT
30 Q_OBJECT
30
31
31− Q_ENUMS(Roles)
32−
33− Q_PROPERTY(int widgetColumnCount READ widgetColumnCount WRITE setWidgetColumnCount NOTIFY widgetColumnCountChanged)
34−
35public:
32public:
36 explicit PreviewStack(QObject* parent = 0);
33 explicit PreviewStack(QObject* parent = 0);
37 virtual ~PreviewStack();
34 virtual ~PreviewStack();
38
35
39− enum Roles {
40− RolePreviewModel
41− };
42−
43 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
36 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
44− QHash<int, QByteArray> roleNames() const override;
45 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
37 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
46
38
47− Q_INVOKABLE PreviewModel* get(int index) const;
39+ Q_INVOKABLE unity::shell::scopes::PreviewModelInterface* getPreviewModel(int index) const override;
48−
49− void setWidgetColumnCount(int columnCount);
50− int widgetColumnCount() const;
51
40
52−Q_SIGNALS:
41+ void setWidgetColumnCount(int columnCount) override;
53− void widgetColumnCountChanged();
42+ int widgetColumnCount() const override;
54
43
55private:
44private:
56 QList<PreviewModel*> m_previews;
45 QList<PreviewModel*> m_previews;
tests/mocks/Unity/fake_previewwidgetmodel.cpp+2−10
@@ -35,12 +35,9 @@ struct PreviewData
35 }
35 }
36};
36};
37
37
38−PreviewWidgetModel::PreviewWidgetModel(QObject* parent) : QAbstractListModel(parent)
38+PreviewWidgetModel::PreviewWidgetModel(QObject* parent)
39+ : unity::shell::scopes::PreviewWidgetModelInterface(parent)
39{
40{
40− m_roles[Roles::RoleWidgetId] = "widgetId";
41− m_roles[Roles::RoleType] = "type";
42− m_roles[Roles::RoleProperties] = "properties";
43−
44 populateWidgets();
41 populateWidgets();
45}
42}
46
43
@@ -60,11 +57,6 @@ void PreviewWidgetModel::populateWidgets()
60
57
61}
58}
62
59
63−QHash<int, QByteArray> PreviewWidgetModel::roleNames() const
64−{
65− return m_roles;
66−}
67−
68int PreviewWidgetModel::rowCount(const QModelIndex&) const
60int PreviewWidgetModel::rowCount(const QModelIndex&) const
69{
61{
70 return m_previewWidgets.size();
62 return m_previewWidgets.size();
tests/mocks/Unity/fake_previewwidgetmodel.h+3−12
@@ -18,33 +18,24 @@
18#ifndef FAKE_PREVIEWWIDGETMODEL_H
18#ifndef FAKE_PREVIEWWIDGETMODEL_H
19#define FAKE_PREVIEWWIDGETMODEL_H
19#define FAKE_PREVIEWWIDGETMODEL_H
20
20
21−#include <QAbstractListModel>
21+#include <unity/shell/scopes/PreviewWidgetModelInterface.h>
22+
22#include <QSharedPointer>
23#include <QSharedPointer>
23#include <QVariantMap>
24#include <QVariantMap>
24
25
25class PreviewData;
26class PreviewData;
26
27
27−class PreviewWidgetModel : public QAbstractListModel
28+class PreviewWidgetModel : public unity::shell::scopes::PreviewWidgetModelInterface
28{
29{
29 Q_OBJECT
30 Q_OBJECT
30
31
31− Q_ENUMS(Roles)
32−
33public:
32public:
34 explicit PreviewWidgetModel(QObject* parent = 0);
33 explicit PreviewWidgetModel(QObject* parent = 0);
35
34
36− enum Roles {
37− RoleWidgetId,
38− RoleType,
39− RoleProperties
40− };
41−
42 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
35 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
43− QHash<int, QByteArray> roleNames() const override;
44 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
36 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
45
37
46private:
38private:
47− QHash<int, QByteArray> m_roles;
48 QList<QSharedPointer<PreviewData>> m_previewWidgets;
39 QList<QSharedPointer<PreviewData>> m_previewWidgets;
49
40
50 void populateWidgets();
41 void populateWidgets();
tests/mocks/Unity/fake_resultsmodel.cpp+1−44
@@ -23,25 +23,10 @@
23#include <paths.h>
23#include <paths.h>
24
24
25ResultsModel::ResultsModel(int result_count, int categoryId, QObject* parent)
25ResultsModel::ResultsModel(int result_count, int categoryId, QObject* parent)
26− : QAbstractListModel(parent)
26+ : unity::shell::scopes::ResultsModelInterface(parent)
27 , m_result_count(result_count)
27 , m_result_count(result_count)
28 , m_categoryId(categoryId)
28 , m_categoryId(categoryId)
29{
29{
30− m_roles[ResultsModel::RoleUri] = "uri";
31− m_roles[ResultsModel::RoleCategoryId] = "categoryId";
32− m_roles[ResultsModel::RoleDndUri] = "dndUri";
33− m_roles[ResultsModel::RoleResult] = "result";
34− m_roles[ResultsModel::RoleTitle] = "title";
35− m_roles[ResultsModel::RoleArt] = "art";
36− m_roles[ResultsModel::RoleSubtitle] = "subtitle";
37− m_roles[ResultsModel::RoleMascot] = "mascot";
38− m_roles[ResultsModel::RoleEmblem] = "emblem";
39− m_roles[ResultsModel::RoleOldPrice] = "oldPrice";
40− m_roles[ResultsModel::RolePrice] = "price";
41− m_roles[ResultsModel::RoleAltPrice] = "altPrice";
42− m_roles[ResultsModel::RoleRating] = "rating";
43− m_roles[ResultsModel::RoleAltRating] = "altRating";
44− m_roles[ResultsModel::RoleSummary] = "summary";
45}
30}
46
31
47QString ResultsModel::categoryId() const
32QString ResultsModel::categoryId() const
@@ -54,12 +39,6 @@ void ResultsModel::setCategoryId(QString const& /*id*/)
54 qFatal("Calling un-implemented ResultsModel::setCategoryId");
39 qFatal("Calling un-implemented ResultsModel::setCategoryId");
55}
40}
56
41
57−QHash<int, QByteArray>
58−ResultsModel::roleNames() const
59−{
60− return m_roles;
61−}
62−
63int ResultsModel::rowCount(const QModelIndex& parent) const
42int ResultsModel::rowCount(const QModelIndex& parent) const
64{
43{
65 Q_UNUSED(parent);
44 Q_UNUSED(parent);
@@ -72,23 +51,6 @@ int ResultsModel::count() const
72 return rowCount();
51 return rowCount();
73}
52}
74
53
75−QVariant ResultsModel::get(int row) const
76−{
77− if (row >= m_result_count || row < 0) return QVariantMap();
78−
79− QVariantMap result;
80− QModelIndex modelIndex(index(row));
81− QHashIterator<int, QByteArray> it(roleNames());
82− while (it.hasNext()) {
83− it.next();
84− QVariant val(data(modelIndex, it.key()));
85− if (val.isNull()) continue;
86− result[it.value()] = val;
87− }
88−
89− return result;
90−}
91−
92QVariant
54QVariant
93ResultsModel::data(const QModelIndex& index, int role) const
55ResultsModel::data(const QModelIndex& index, int role) const
94{
56{
@@ -106,11 +68,6 @@ ResultsModel::data(const QModelIndex& index, int role) const
106 return QString("Subtitle.%1.%2").arg(m_categoryId).arg(index.row());
68 return QString("Subtitle.%1.%2").arg(m_categoryId).arg(index.row());
107 case RoleMascot:
69 case RoleMascot:
108 case RoleEmblem:
70 case RoleEmblem:
109− case RoleOldPrice:
110− case RolePrice:
111− case RoleAltPrice:
112− case RoleRating:
113− case RoleAltRating:
114 case RoleSummary:
71 case RoleSummary:
115 default:
72 default:
116 return QVariant();
73 return QVariant();
tests/mocks/Unity/fake_resultsmodel.h+5−37
@@ -21,58 +21,26 @@
21#ifndef FAKE_RESULTS_MODEL_H
21#ifndef FAKE_RESULTS_MODEL_H
22#define FAKE_RESULTS_MODEL_H
22#define FAKE_RESULTS_MODEL_H
23
23
24−#include <QAbstractListModel>
24+#include <unity/shell/scopes/ResultsModelInterface.h>
25
25
26−class ResultsModel : public QAbstractListModel
26+class ResultsModel : public unity::shell::scopes::ResultsModelInterface
27{
27{
28 Q_OBJECT
28 Q_OBJECT
29
29
30− Q_ENUMS(Roles)
31−
32− Q_PROPERTY(QString categoryId READ categoryId WRITE setCategoryId NOTIFY categoryIdChanged)
33− Q_PROPERTY(int count READ count NOTIFY countChanged)
34−
35public:
30public:
36 explicit ResultsModel(int result_count, int categoryId, QObject* parent = 0);
31 explicit ResultsModel(int result_count, int categoryId, QObject* parent = 0);
37
32
38− enum Roles {
39− RoleUri,
40− RoleCategoryId,
41− RoleDndUri,
42− RoleResult,
43− // card components
44− RoleTitle,
45− RoleArt,
46− RoleSubtitle,
47− RoleMascot,
48− RoleEmblem,
49− RoleOldPrice,
50− RolePrice,
51− RoleAltPrice,
52− RoleRating,
53− RoleAltRating,
54− RoleSummary
55− };
56−
57 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
33 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
58− QHash<int, QByteArray> roleNames() const override;
59 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
34 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
60
35
61− Q_INVOKABLE QVariant get(int row) const;
62−
63 /* getters */
36 /* getters */
64− QString categoryId() const;
37+ QString categoryId() const override;
65− int count() const;
38+ int count() const override;
66
39
67 /* setters */
40 /* setters */
68− void setCategoryId(QString const& id);
41+ void setCategoryId(QString const& id) override;
69−
70−Q_SIGNALS:
71− void categoryIdChanged();
72− void countChanged();
73
42
74private:
43private:
75− QHash<int, QByteArray> m_roles;
76 int m_result_count;
44 int m_result_count;
77 int m_categoryId;
45 int m_categoryId;
78};
46};
tests/mocks/Unity/fake_scope.cpp+3−14
@@ -22,7 +22,7 @@ Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
22}
22}
23
23
24Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
24Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
25− : QObject(parent)
25+ : unity::shell::scopes::ScopeInterface(parent)
26 , m_id(id)
26 , m_id(id)
27 , m_name(name)
27 , m_name(name)
28 , m_visible(visible)
28 , m_visible(visible)
@@ -61,15 +61,11 @@ QString Scope::shortcut() const {
61 return QString("");
61 return QString("");
62}
62}
63
63
64−bool Scope::connected() const {
65− return true;
66−}
67−
68bool Scope::searchInProgress() const {
64bool Scope::searchInProgress() const {
69 return m_searching;
65 return m_searching;
70}
66}
71
67
72−Categories* Scope::categories() const {
68+unity::shell::scopes::CategoriesInterface* Scope::categories() const {
73 return m_categories;
69 return m_categories;
74}
70}
75
71
@@ -89,13 +85,6 @@ bool Scope::isActive() const {
89 return m_isActive;
85 return m_isActive;
90}
86}
91
87
92−void Scope::setName(const QString &str) {
93− if (str != m_name) {
94− m_name = str;
95− Q_EMIT nameChanged(m_name);
96− }
97−}
98−
99void Scope::setSearchQuery(const QString &str) {
88void Scope::setSearchQuery(const QString &str) {
100 if (str != m_searchQuery) {
89 if (str != m_searchQuery) {
101 m_searchQuery = str;
90 m_searchQuery = str;
@@ -149,7 +138,7 @@ void Scope::cancelActivation()
149{
138{
150}
139}
151
140
152−void Scope::closeScope(Scope* /*scope*/)
141+void Scope::closeScope(unity::shell::scopes::ScopeInterface* /*scope*/)
153{
142{
154 qFatal("Scope::closeScope is not implemented");
143 qFatal("Scope::closeScope is not implemented");
155}
144}
tests/mocks/Unity/fake_scope.h+26−72
@@ -17,93 +17,47 @@
17#ifndef FAKE_SCOPE_H
17#ifndef FAKE_SCOPE_H
18#define FAKE_SCOPE_H
18#define FAKE_SCOPE_H
19
19
20+#include <unity/shell/scopes/ScopeInterface.h>
21+
20#include "fake_categories.h"
22#include "fake_categories.h"
21#include "fake_previewstack.h"
23#include "fake_previewstack.h"
22
24
23−#include <QObject>
24#include <QTimer>
25#include <QTimer>
25
26
26−class Preview;
27+class Scope : public unity::shell::scopes::ScopeInterface
27−
28−class Scope : public QObject
29{
28{
30 Q_OBJECT
29 Q_OBJECT
31
30
32− Q_PROPERTY(QString id READ id NOTIFY idChanged)
33− Q_PROPERTY(QString name READ name NOTIFY nameChanged)
34− Q_PROPERTY(QString iconHint READ iconHint NOTIFY iconHintChanged)
35− Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
36− Q_PROPERTY(QString searchHint READ searchHint NOTIFY searchHintChanged)
37− Q_PROPERTY(bool searchInProgress READ searchInProgress WRITE setSearchInProgress NOTIFY searchInProgressChanged)
38− Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
39− Q_PROPERTY(QString shortcut READ shortcut NOTIFY shortcutChanged)
40− Q_PROPERTY(Categories* categories READ categories NOTIFY categoriesChanged)
41− //Q_PROPERTY(Filters* filters READ filters NOTIFY filtersChanged)
42−
43− Q_PROPERTY(QString searchQuery READ searchQuery WRITE setSearchQuery NOTIFY searchQueryChanged)
44− Q_PROPERTY(QString noResultsHint READ noResultsHint WRITE setNoResultsHint NOTIFY noResultsHintChanged)
45− Q_PROPERTY(QString formFactor READ formFactor WRITE setFormFactor NOTIFY formFactorChanged)
46− Q_PROPERTY(bool isActive READ isActive WRITE setActive NOTIFY isActiveChanged)
47−
48public:
31public:
49 Scope(QObject* parent = 0);
32 Scope(QObject* parent = 0);
50 Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0);
33 Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0);
51
34
52 /* getters */
35 /* getters */
53− QString id() const;
36+ QString id() const override;
54− QString name() const;
37+ QString name() const override;
55− QString iconHint() const;
38+ QString iconHint() const override;
56− QString description() const;
39+ QString description() const override;
57− QString searchHint() const;
40+ QString searchHint() const override;
58− bool visible() const;
41+ bool visible() const override;
59− QString shortcut() const;
42+ QString shortcut() const override;
60− bool connected() const;
61− bool searchInProgress() const;
43+ bool searchInProgress() const override;
62− Categories* categories() const;
44+ unity::shell::scopes::CategoriesInterface* categories() const override;
63− QString searchQuery() const;
45+ QString searchQuery() const override;
64− QString noResultsHint() const;
46+ QString noResultsHint() const override;
65− QString formFactor() const;
47+ QString formFactor() const override;
66− bool isActive() const;
48+ bool isActive() const override;
67
49
68 /* setters */
50 /* setters */
69− void setName(const QString& name);
70− void setSearchQuery(const QString& search_query);
51+ void setSearchQuery(const QString& search_query) override;
71− void setNoResultsHint(const QString& hint);
52+ void setNoResultsHint(const QString& hint) override;
72− void setFormFactor(const QString& form_factor);
53+ void setFormFactor(const QString& form_factor) override;
73− void setActive(const bool);
54+ void setActive(const bool) override;
74− void setSearchInProgress(const bool inProg);
55+ Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
75−
56+
76− Q_INVOKABLE void activate(QVariant const& result);
57+ Q_INVOKABLE void activate(QVariant const& result) override;
77− Q_INVOKABLE PreviewStack* preview(QVariant const& result);
58+ Q_INVOKABLE PreviewStack* preview(QVariant const& result) override;
78− Q_INVOKABLE void cancelActivation();
59+ Q_INVOKABLE void cancelActivation() override;
79− Q_INVOKABLE void closeScope(Scope* scope);
60+ Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
80−
81−Q_SIGNALS:
82− void idChanged();
83− void nameChanged(const QString&);
84− void iconHintChanged(const QString&);
85− void descriptionChanged(const QString&);
86− void searchHintChanged(const QString&);
87− void searchInProgressChanged();
88− void visibleChanged(bool);
89− void shortcutChanged(const QString&);
90− void categoriesChanged();
91− //void filtersChanged();
92− void searchQueryChanged();
93− void noResultsHintChanged();
94− void formFactorChanged();
95− void isActiveChanged(bool);
96−
97− // signals triggered by activate(..) or preview(..) requests.
98− void showDash();
99− void hideDash();
100− void gotoUri(const QString &uri);
101− void activated();
102− void previewRequested(QVariant const& result);
103− void gotoScope(QString const& scopeId);
104− void openScope(Scope* scope);
105−
106− void activateApplication(const QString &desktop);
107
61
108protected:
62protected:
109
63
tests/mocks/Unity/fake_scopes.cpp+11−22
@@ -25,15 +25,10 @@
25#include <QTimer>
25#include <QTimer>
26
26
27Scopes::Scopes(QObject *parent)
27Scopes::Scopes(QObject *parent)
28−: QAbstractListModel(parent)
28+ : unity::shell::scopes::ScopesInterface(parent)
29−, m_loaded(false)
29+ , m_loaded(false)
30−, timer(this)
30+ , timer(this)
31{
31{
32− m_roles[Scopes::RoleScope] = "scope";
33− m_roles[Scopes::RoleId] = "id";
34− m_roles[Scopes::RoleVisible] = "visible";
35− m_roles[Scopes::RoleTitle] = "title";
36−
37 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
32 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
38 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
33 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
39 QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
34 QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
@@ -83,11 +78,6 @@ void Scopes::load()
83 timer.start();
78 timer.start();
84}
79}
85
80
86−QHash<int, QByteArray> Scopes::roleNames() const
87−{
88− return m_roles;
89−}
90−
91int Scopes::rowCount(const QModelIndex&) const
81int Scopes::rowCount(const QModelIndex&) const
92{
82{
93 return m_scopes.count();
83 return m_scopes.count();
@@ -114,14 +104,18 @@ QVariant Scopes::data(const QModelIndex& index, int role) const
114 }
104 }
115}
105}
116
106
117−QVariant Scopes::get(int row) const
107+unity::shell::scopes::ScopeInterface* Scopes::getScope(int row) const
118{
108{
119− return data(QAbstractListModel::index(row), 0);
109+ if (row < 0 || row >= m_scopes.size()) {
110+ return nullptr;
111+ }
112+
113+ return m_scopes[row];
120}
114}
121
115
122−QVariant Scopes::get(QString const&) const
116+unity::shell::scopes::ScopeInterface* Scopes::getScope(QString const&) const
123{
117{
124− return QVariant();
118+ return nullptr;
125}
119}
126
120
127QModelIndex Scopes::parent(const QModelIndex&) const
121QModelIndex Scopes::parent(const QModelIndex&) const
@@ -134,11 +128,6 @@ bool Scopes::loaded() const
134 return m_loaded;
128 return m_loaded;
135}
129}
136
130
137−int Scopes::count() const
138−{
139− return rowCount();
140−}
141−
142void Scopes::addScope(Scope* scope)
131void Scopes::addScope(Scope* scope)
143{
132{
144 int index = rowCount();
133 int index = rowCount();
tests/mocks/Unity/fake_scopes.h+7−24
@@ -19,36 +19,27 @@
19#ifndef FAKE_SCOPES_H
19#ifndef FAKE_SCOPES_H
20#define FAKE_SCOPES_H
20#define FAKE_SCOPES_H
21
21
22+#include <unity/shell/scopes/ScopesInterface.h>
23+
22// Local
24// Local
23#include "fake_scope.h"
25#include "fake_scope.h"
24
26
25// Qt
27// Qt
26−#include <QAbstractListModel>
27#include <QList>
28#include <QList>
28#include <QTimer>
29#include <QTimer>
29
30
30−class Scopes : public QAbstractListModel
31+class Scopes : public unity::shell::scopes::ScopesInterface
31{
32{
32 Q_OBJECT
33 Q_OBJECT
33− Q_ENUMS(Roles)
34− Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged)
35− Q_PROPERTY(int count READ count NOTIFY countChanged)
36
34
37public:
35public:
38 explicit Scopes(QObject *parent = 0);
36 explicit Scopes(QObject *parent = 0);
39 ~Scopes();
37 ~Scopes();
40
38
41− enum Roles {
42− RoleScope,
43− RoleId,
44− RoleVisible,
45− RoleTitle
46− };
47−
48− Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const;
39+ Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const override;
49
40
50− Q_INVOKABLE QVariant get(int row) const;
41+ Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(int row) const override;
51− Q_INVOKABLE QVariant get(const QString& scope_id) const;
42+ Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(const QString& scope_id) const override;
52
43
53 Q_INVOKABLE void addScope(Scope* scope);
44 Q_INVOKABLE void addScope(Scope* scope);
54
45
@@ -56,23 +47,15 @@ public:
56 Q_INVOKABLE void load();
47 Q_INVOKABLE void load();
57
48
58 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
49 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
59− QHash<int, QByteArray> roleNames() const;
60 QModelIndex parent ( const QModelIndex & index ) const;
50 QModelIndex parent ( const QModelIndex & index ) const;
61
51
62− bool loaded() const;
52+ bool loaded() const override;
63− int count() const;
64−
65−Q_SIGNALS:
66− void activateScopeRequested(const QString& scope_id);
67− void loadedChanged(bool);
68− void countChanged();
69
53
70private Q_SLOTS:
54private Q_SLOTS:
71 void updateScopes();
55 void updateScopes();
72
56
73private:
57private:
74 QList<Scope*> m_scopes;
58 QList<Scope*> m_scopes;
75− QHash<int, QByteArray> m_roles;
76 bool m_loaded;
59 bool m_loaded;
77 QTimer timer;
60 QTimer timer;
78};
61};
tests/mocks/Unity/fake_unity_plugin.cpp+3−2
@@ -40,8 +40,9 @@ void FakeUnityPlugin::registerTypes(const char *uri)
40 Q_ASSERT(uri == QLatin1String("Unity"));
40 Q_ASSERT(uri == QLatin1String("Unity"));
41
41
42 qmlRegisterType<Scopes>(uri, 0, 2, "Scopes");
42 qmlRegisterType<Scopes>(uri, 0, 2, "Scopes");
43− qmlRegisterType<Scope>(uri, 0, 2, "Scope");
43+ qmlRegisterType<Scope>(uri, 0, 2, "MockScope");
44+ qmlRegisterUncreatableType<unity::shell::scopes::ScopeInterface>(uri, 0, 2, "Scope", "Can't create Scope object in QML.");
44− qmlRegisterUncreatableType<Categories>(uri, 0, 2, "Categories", "Can't create Categories object in QML.");
45+ qmlRegisterUncreatableType<unity::shell::scopes::CategoriesInterface>(uri, 0, 2, "Categories", "Can't create Categories object in QML.");
45 qmlRegisterUncreatableType<ResultsModel>(uri, 0, 2, "ResultsModel", "Can't create ResultsModel object in QML.");
46 qmlRegisterUncreatableType<ResultsModel>(uri, 0, 2, "ResultsModel", "Can't create ResultsModel object in QML.");
46 qmlRegisterType<PreviewModel>(uri, 0, 2, "FakePreviewModel");
47 qmlRegisterType<PreviewModel>(uri, 0, 2, "FakePreviewModel");
47 qmlRegisterUncreatableType<PreviewWidgetModel>(uri, 0, 2, "PreviewWidgetModel", "Can't create new PreviewWidgetModel in QML. Get them from PreviewModel instance.");
48 qmlRegisterUncreatableType<PreviewWidgetModel>(uri, 0, 2, "PreviewWidgetModel", "Can't create new PreviewWidgetModel in QML. Get them from PreviewModel instance.");
tests/plugins/Dash/horizontaljournaltest.cpp+6−6
@@ -258,8 +258,8 @@ private Q_SLOTS:
258
258
259 void testDelegateCreationRanges()
259 void testDelegateCreationRanges()
260 {
260 {
261− hj->setDelegateCreationBegin(300);
261+ hj->setDisplayMarginBeginning(-300);
262− hj->setDelegateCreationEnd(view->height());
262+ hj->setDisplayMarginEnd(-(hj->height() - view->height()));
263
263
264 QTRY_COMPARE(hj->m_firstVisibleIndex, 6);
264 QTRY_COMPARE(hj->m_firstVisibleIndex, 6);
265 QTRY_COMPARE(hj->m_visibleItems.count(), 7);
265 QTRY_COMPARE(hj->m_visibleItems.count(), 7);
@@ -274,8 +274,8 @@ private Q_SLOTS:
274 QTRY_COMPARE(hj->m_lastInRowIndexPosition[ 7], 210.);
274 QTRY_COMPARE(hj->m_lastInRowIndexPosition[ 7], 210.);
275 QTRY_COMPARE(hj->m_lastInRowIndexPosition[12], 305.);
275 QTRY_COMPARE(hj->m_lastInRowIndexPosition[12], 305.);
276
276
277− hj->resetDelegateCreationBegin();
277+ hj->setDisplayMarginBeginning(0);
278− hj->resetDelegateCreationEnd();
278+ hj->setDisplayMarginEnd(0);
279
279
280 // This is exactly the same block as the first again
280 // This is exactly the same block as the first again
281 checkInitialPositions();
281 checkInitialPositions();
@@ -469,8 +469,8 @@ private Q_SLOTS:
469
469
470 void testNegativeDelegateCreationRange()
470 void testNegativeDelegateCreationRange()
471 {
471 {
472− hj->setDelegateCreationBegin(0);
472+ hj->setDisplayMarginBeginning(0);
473− hj->setDelegateCreationEnd(-100);
473+ hj->setDisplayMarginEnd(-(hj->height() + 100));
474
474
475 QStringList widthList;
475 QStringList widthList;
476 widthList << "100" << "50" << "50" << "30";
476 widthList << "100" << "50" << "50" << "30";
tests/plugins/Dash/organicgridtest.cpp+2−5
@@ -499,17 +499,14 @@ private Q_SLOTS:
499 QTRY_COMPARE(grid->m_firstVisibleIndex, 0);
499 QTRY_COMPARE(grid->m_firstVisibleIndex, 0);
500 QTRY_COMPARE(grid->m_visibleItems.count(), 198);
500 QTRY_COMPARE(grid->m_visibleItems.count(), 198);
501
501
502− grid->setDelegateCreationBegin(300);
502+ grid->setDisplayMarginBeginning(-300);
503− grid->setDelegateCreationEnd(400);
503+ grid->setDisplayMarginEnd(-(grid->height() - 400));
504 checkImplicitHeight(2290);
504 checkImplicitHeight(2290);
505
505
506 QTRY_COMPARE(grid->m_firstVisibleIndex, 36);
506 QTRY_COMPARE(grid->m_firstVisibleIndex, 36);
507 QTRY_COMPARE(grid->m_visibleItems.count(), 54);
507 QTRY_COMPARE(grid->m_visibleItems.count(), 54);
508 checkImplicitHeight(2290);
508 checkImplicitHeight(2290);
509
509
510− grid->resetDelegateCreationBegin();
511− grid->resetDelegateCreationEnd();
512−
513 view->resize(470, 470);
510 view->resize(470, 470);
514
511
515 grid->setSmallDelegateSize(QSizeF(90, 90));
512 grid->setSmallDelegateSize(QSizeF(90, 90));
tests/plugins/Dash/verticaljournaltest.cpp+6−6
@@ -263,8 +263,8 @@ private Q_SLOTS:
263
263
264 void testDelegateCreationRanges()
264 void testDelegateCreationRanges()
265 {
265 {
266− vj->setDelegateCreationBegin(200);
266+ vj->setDisplayMarginBeginning(-200);
267− vj->setDelegateCreationEnd(view->height());
267+ vj->setDisplayMarginEnd(-(vj->height() - view->height()));
268
268
269 QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
269 QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
270 QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 4);
270 QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 4);
@@ -286,8 +286,8 @@ private Q_SLOTS:
286 verifyItem(vj->m_columnVisibleItems[1][3], 15, 160, 430, false);
286 verifyItem(vj->m_columnVisibleItems[1][3], 15, 160, 430, false);
287 QCOMPARE(vj->implicitHeight(), 690. + 4. * 690. / 16.);
287 QCOMPARE(vj->implicitHeight(), 690. + 4. * 690. / 16.);
288
288
289− vj->resetDelegateCreationBegin();
289+ vj->setDisplayMarginBeginning(0);
290− vj->resetDelegateCreationEnd();
290+ vj->setDisplayMarginEnd(0);
291
291
292 // This is exactly the same block as the first again
292 // This is exactly the same block as the first again
293 checkInitialPositions();
293 checkInitialPositions();
@@ -478,8 +478,8 @@ private Q_SLOTS:
478
478
479 void testNegativeDelegateCreationRange()
479 void testNegativeDelegateCreationRange()
480 {
480 {
481− vj->setDelegateCreationBegin(0);
481+ vj->setDisplayMarginBeginning(0);
482− vj->setDelegateCreationEnd(-100);
482+ vj->setDisplayMarginEnd(-(vj->height() + 100));
483
483
484 QStringList heightList;
484 QStringList heightList;
485 heightList << "100" << "50" << "50" << "30";
485 heightList << "100" << "50" << "50" << "30";
tests/qmltests/Components/tst_PageHeaderLabel.qml+4−4
@@ -26,7 +26,7 @@ Item {
26 width: units.gu(110)
26 width: units.gu(110)
27 height: units.gu(30)
27 height: units.gu(30)
28
28
29− Scope {
29+ MockScope {
30 id: scopeMock
30 id: scopeMock
31 }
31 }
32
32
@@ -148,17 +148,17 @@ Item {
148
148
149 pageHeader.triggerSearch()
149 pageHeader.triggerSearch()
150
150
151− scopeMock.searchInProgress = false
151+ scopeMock.setSearchInProgress(false);
152 compare(searchIndicator.running, false, "Search indicator is running.")
152 compare(searchIndicator.running, false, "Search indicator is running.")
153 tryCompare(primaryImage, "visible", true)
153 tryCompare(primaryImage, "visible", true)
154
154
155− scopeMock.searchInProgress = true
155+ scopeMock.setSearchInProgress(true);
156 compare(searchIndicator.running, true, "Search indicator isn't running.")
156 compare(searchIndicator.running, true, "Search indicator isn't running.")
157 tryCompare(primaryImage, "visible", false)
157 tryCompare(primaryImage, "visible", false)
158 }
158 }
159
159
160 function cleanup() {
160 function cleanup() {
161− scopeMock.searchInProgress = false;
161+ scopeMock.setSearchInProgress(false);
162 pageHeader.resetSearch();
162 pageHeader.resetSearch();
163 }
163 }
164
164
tests/qmltests/Dash/tst_DashContent.qml+5−5
@@ -166,7 +166,7 @@ Item {
166
166
167 // test greater than scope count.
167 // test greater than scope count.
168 var currentScopeIndex = dashContent.currentIndex;
168 var currentScopeIndex = dashContent.currentIndex;
169− dashContent.setCurrentScopeAtIndex(scopesModel.count, true, false);
169+ dashContent.setCurrentScopeAtIndex(8, true, false);
170 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
170 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
171 }
171 }
172
172
@@ -195,7 +195,7 @@ Item {
195 dashContent.setCurrentScopeAtIndex(data.index, true, false);
195 dashContent.setCurrentScopeAtIndex(data.index, true, false);
196 tryCompareFunction(get_current_item_object_name, data.objectName)
196 tryCompareFunction(get_current_item_object_name, data.objectName)
197 var pageHeader = findChild(dashContent, "pageHeader");
197 var pageHeader = findChild(dashContent, "pageHeader");
198− compare(pageHeader.scope, scopesModel.get(data.index));
198+ compare(pageHeader.scope, scopesModel.getScope(data.index));
199 }
199 }
200
200
201 function test_is_active_data() {
201 function test_is_active_data() {
@@ -212,9 +212,9 @@ Item {
212 dashContent.setCurrentScopeAtIndex(data.select, true, false);
212 dashContent.setCurrentScopeAtIndex(data.select, true, false);
213 dashContent.visible = data.visible;
213 dashContent.visible = data.visible;
214
214
215− tryCompare(scopesModel.get(0), "isActive", data.active0);
215+ tryCompare(scopesModel.getScope(0), "isActive", data.active0);
216− tryCompare(scopesModel.get(1), "isActive", data.active1);
216+ tryCompare(scopesModel.getScope(1), "isActive", data.active1);
217− tryCompare(scopesModel.get(2), "isActive", data.active2);
217+ tryCompare(scopesModel.getScope(2), "isActive", data.active2);
218 }
218 }
219
219
220 function doFindMusicButton(parent) {
220 function doFindMusicButton(parent) {
tests/qmltests/Dash/tst_GenericScopeView.qml+11−11
@@ -39,7 +39,7 @@ Item {
39 id: scopes
39 id: scopes
40
40
41 onLoadedChanged: {
41 onLoadedChanged: {
42− genericScopeView.scope = scopes.get(2)
42+ genericScopeView.scope = scopes.getScope(2)
43 }
43 }
44 }
44 }
45
45
@@ -67,7 +67,7 @@ Item {
67 when: scopes.loaded && windowShown
67 when: scopes.loaded && windowShown
68
68
69 function init() {
69 function init() {
70− genericScopeView.scope = scopes.get(2)
70+ genericScopeView.scope = scopes.getScope(2)
71 shell.width = units.gu(120)
71 shell.width = units.gu(120)
72 genericScopeView.categoryView.positionAtBeginning();
72 genericScopeView.categoryView.positionAtBeginning();
73 tryCompare(genericScopeView.categoryView, "contentY", 0)
73 tryCompare(genericScopeView.categoryView, "contentY", 0)
@@ -96,31 +96,31 @@ Item {
96
96
97 function test_showDash() {
97 function test_showDash() {
98 previewListView.open = true;
98 previewListView.open = true;
99− scopes.get(2).showDash();
99+ scopes.getScope(2).showDash();
100 tryCompare(previewListView, "open", false);
100 tryCompare(previewListView, "open", false);
101 }
101 }
102
102
103 function test_hideDash() {
103 function test_hideDash() {
104 previewListView.open = true;
104 previewListView.open = true;
105− scopes.get(2).hideDash();
105+ scopes.getScope(2).hideDash();
106 tryCompare(previewListView, "open", false);
106 tryCompare(previewListView, "open", false);
107 }
107 }
108
108
109 function test_searchQuery() {
109 function test_searchQuery() {
110− genericScopeView.scope = scopes.get(0);
110+ genericScopeView.scope = scopes.getScope(0);
111 genericScopeView.scope.searchQuery = "test";
111 genericScopeView.scope.searchQuery = "test";
112− genericScopeView.scope = scopes.get(1);
112+ genericScopeView.scope = scopes.getScope(1);
113 genericScopeView.scope.searchQuery = "test2";
113 genericScopeView.scope.searchQuery = "test2";
114− genericScopeView.scope = scopes.get(0);
114+ genericScopeView.scope = scopes.getScope(0);
115 tryCompare(genericScopeView.scope, "searchQuery", "test");
115 tryCompare(genericScopeView.scope, "searchQuery", "test");
116− genericScopeView.scope = scopes.get(1);
116+ genericScopeView.scope = scopes.getScope(1);
117 tryCompare(genericScopeView.scope, "searchQuery", "test2");
117 tryCompare(genericScopeView.scope, "searchQuery", "test2");
118 }
118 }
119
119
120 function test_changeScope() {
120 function test_changeScope() {
121 genericScopeView.scope.searchQuery = "test"
121 genericScopeView.scope.searchQuery = "test"
122− genericScopeView.scope = scopes.get(1)
122+ genericScopeView.scope = scopes.getScope(1)
123− genericScopeView.scope = scopes.get(2)
123+ genericScopeView.scope = scopes.getScope(2)
124 tryCompare(genericScopeView.scope, "searchQuery", "test")
124 tryCompare(genericScopeView.scope, "searchQuery", "test")
125 }
125 }
126
126
@@ -199,7 +199,7 @@ Item {
199 var header0 = findChild(genericScopeView, "dashSectionHeader0")
199 var header0 = findChild(genericScopeView, "dashSectionHeader0")
200 mouseClick(header0, header0.width / 2, header0.height / 2);
200 mouseClick(header0, header0.width / 2, header0.height / 2);
201 tryCompare(category, "filtered", false);
201 tryCompare(category, "filtered", false);
202− tryCompare(category.item, "delegateCreationEnd", category.item.delegateCreationBegin + genericScopeView.height);
202+ tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
203 mouseClick(header0, header0.width / 2, header0.height / 2);
203 mouseClick(header0, header0.width / 2, header0.height / 2);
204 tryCompare(category, "filtered", true);
204 tryCompare(category, "filtered", true);
205 }
205 }