Merge lp:~bzoltan/ubuntu-ui-toolkit/landing-1010 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zoltan Balogh
Approved revision: no longer in the source branch.
Merged at revision: 1115
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/landing-1010
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 2311 lines (+740/-538)
39 files modified
debian/changelog (+82/-0)
debian/control (+0/-1)
examples/ubuntu-ui-toolkit-gallery/Icons.qml (+3/-2)
examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/TextInputs.qml (+12/-0)
modules/Ubuntu/Components/Icon10.qml (+15/-33)
modules/Ubuntu/Components/ListItems/Empty.qml (+1/-1)
modules/Ubuntu/Components/OrientationHelper.qml (+4/-1)
modules/Ubuntu/Components/Popups/Dialog.qml (+40/-37)
modules/Ubuntu/Components/TextArea.qml (+2/-0)
modules/Ubuntu/Components/TextCursor.qml (+1/-0)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+1/-0)
modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml (+1/-0)
modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml (+1/-0)
modules/Ubuntu/Components/ToolbarItems.qml (+1/-1)
modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp (+35/-50)
modules/Ubuntu/Components/plugin/adapters/alarmsadapter_p.h (+2/-1)
modules/Ubuntu/Components/plugin/alarmmanager_p.cpp (+5/-0)
modules/Ubuntu/Components/plugin/alarmmanager_p.h (+20/-18)
modules/Ubuntu/Components/plugin/alarmmanager_p_p.h (+2/-0)
modules/Ubuntu/Components/plugin/plugin.cpp (+0/-7)
modules/Ubuntu/Components/plugin/plugin.pro (+1/-3)
modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp (+0/-87)
modules/Ubuntu/Components/plugin/thumbnailgenerator.h (+0/-36)
modules/Ubuntu/Components/plugin/ucactioncontext.h (+1/-0)
modules/Ubuntu/Components/plugin/ucactionmanager.h (+1/-0)
modules/Ubuntu/Components/plugin/ucscalingimageprovider.cpp (+1/-1)
modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.cpp (+123/-66)
modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.h (+4/-37)
modules/Ubuntu/Test/UbuntuTestCase.qml (+23/-22)
tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py (+51/-0)
tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.qml (+70/-0)
tests/qmlapicheck.py (+3/-1)
tests/qmlapicheck.sh (+14/-5)
tests/uitk_test_plan.sh (+153/-88)
tests/unit/add_qmlmakecheck.pri (+1/-1)
tests/unit/tst_alarms/tst_alarms.cpp (+54/-37)
tests/unit/tst_i18n/src/LocalizedApp.qml (+1/-1)
tests/unit_x11/tst_components/tst_textarea.qml (+10/-0)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing-1010
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+237913@code.launchpad.net

Commit message

[ Renato Filho ]
  * Save alarms in invalid time zone. Use invalid time zone to
    floating time alarms. Fixes LP: #1311165

  [ Tim Peeters ]
  * Make icons from theme in showcase gallery scrollable.
    Fixes: LP: #1336279.
  * Fix width of header contents. Fixes LP: #1378261.

  [ Sebastien Bacher ]
  * Don't use simple quotes around translatable strings, xgetting
    ignore those. Fixes LP: #1378774.

  [ Zsombor Egri ]
  * Alarm update regression caused by EDS changes. Also fixes Tags
    update. Requires qtorganizer5-eds updates as well!.
    Fixes LP: #1364949.

  [ Christian Dywan ]
  * Make dialog contents scrollable. Fixes LP: #1376763
  * Make mouseMoveSlowly work with a negative distance.
    Fixes LP: #1343334

Description of the change

[ Renato Filho ]
  * Save alarms in invalid time zone. Use invalid time zone to
    floating time alarms. Fixes LP: #1311165

  [ Tim Peeters ]
  * Make icons from theme in showcase gallery scrollable.
    Fixes: LP: #1336279.
  * Fix width of header contents. Fixes LP: #1378261.

  [ Sebastien Bacher ]
  * Don't use simple quotes around translatable strings, xgetting
    ignore those. Fixes LP: #1378774.

  [ Zsombor Egri ]
  * Alarm update regression caused by EDS changes. Also fixes Tags
    update. Requires qtorganizer5-eds updates as well!.
    Fixes LP: #1364949.

  [ Christian Dywan ]
  * Make dialog contents scrollable. Fixes LP: #1376763
  * Make mouseMoveSlowly work with a negative distance.
    Fixes LP: #1343334

To post a comment you must log in.
1289. By Zoltan Balogh

Sync from staging

1290. By Zoltan Balogh

Sync from landing branch

1291. By Zoltan Balogh

Fix qmlapicheck

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-10-14 14:40:58 +0000
3+++ debian/changelog 2014-10-16 12:58:00 +0000
4@@ -1,3 +1,85 @@
5+ubuntu-ui-toolkit (1.1.1298+14.10.20141007-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ [ Jussi Pakkanen]
8+ * Remove the thumbnailer image provider here, because thumbnailer
9+ provides it by itself Fixes LP: #1368492
10+
11+ [ Lars Uebernickel ]
12+ * Icon: size correctly even if no or only one dimension is given
13+
14+ [ Michael Sheldon]
15+ * Check that orientation changes are acceptable before applying new
16+ orientation based on active window change. Fixes LP: #1375306
17+
18+ [ Zoltán Balogh ]
19+ * Updated test plan executer
20+
21+ [ Zeller Benjamin ]
22+ * RenderTimer includes EGL platform files in the rendertime header,
23+ which can cause problems when included after QDataStream. The
24+ EGL headers pull the XLib files which define the Symbol Status.
25+ * Preparing qmlapicheck to support out of source builds for the
26+ cmake migration
27+
28+ [ Renato Filho ]
29+ * Save alarms in invalid time zone. Use invalid time zone to
30+ floating time alarms.
31+
32+ [ Tim Peeters ]
33+ * Make icons from theme in showcase gallery scrollable.
34+ Fixes: LP: #1336279.
35+ * Fix width of header contents. Fixes LP: #1378261.
36+
37+ [ Sebastien Bacher ]
38+ * Don't use simple quotes around translatable strings, xgetting
39+ ignore those. Fixes LP: #1378774.
40+
41+ [ Zsombor Egri ]
42+ * Alarm update regression caused by EDS changes. Also fixes Tags
43+ update. Requires qtorganizer5-eds updates as well!.
44+ Fixes LP: #1364949.
45+ * Forgotten Interface declaration in objects. Fixes LP: #1378298
46+
47+ [ Christian Dywan ]
48+ * Make dialog contents scrollable. Fixes LP: #1376763
49+ * Make mouseMoveSlowly work with a negative distance.
50+ Fixes LP: #1343334
51+ * Read-only text entries don't blink or visibly take focus
52+ Fixes LP: #1370571
53+ * Anchor overflow button labels to the right.
54+ Fixes LP: #1354812 LP: #1378247
55+ * Don't allow inserting a line break into readOnly text areas.
56+ Fixes LP: #1334344
57+
58+ -- Zoltán Balogh <zoltan@bakter.hu> Fri, 10 Oct 2014 11:19:10 +0300
59+
60+ubuntu-ui-toolkit (1.1.1286+14.10.20141007-0ubuntu2) UNRELEASED; urgency=medium
61+
62+ [ Renato Filho ]
63+ * Save alarms in invalid time zone. Use invalid time zone to
64+ floating time alarms.
65+
66+ [ Tim Peeters ]
67+ * Make icons from theme in showcase gallery scrollable.
68+ Fixes: LP: #1336279.
69+ * Fix width of header contents. Fixes LP: #1378261.
70+
71+ [ Sebastien Bacher ]
72+ * Don't use simple quotes around translatable strings, xgetting
73+ ignore those. Fixes LP: #1378774.
74+
75+ [ Zsombor Egri ]
76+ * Alarm update regression caused by EDS changes. Also fixes Tags
77+ update. Requires qtorganizer5-eds updates as well!.
78+ Fixes LP: #1364949.
79+
80+ [ Christian Dywan ]
81+ * Make dialog contents scrollable. Fixes LP: #1376763
82+ * Make mouseMoveSlowly work with a negative distance.
83+ Fixes LP: #1343334
84+
85+ -- Zoltán Balogh <zoltan@bakter.hu> Fri, 10 Oct 2014 11:19:10 +0300
86+
87 ubuntu-ui-toolkit (1.1.1279.1+14.10.20141014-0ubuntu1) 14.09; urgency=low
88
89 [ Ubuntu daily release ]
90
91=== modified file 'debian/control'
92--- debian/control 2014-10-01 07:35:42 +0000
93+++ debian/control 2014-10-16 12:58:00 +0000
94@@ -35,7 +35,6 @@
95 libqt5organizer5,
96 qtpim5-dev,
97 language-pack-en-base,
98- libthumbnailer-dev,
99 libdbus-1-dev,
100 libnih-dbus-dev,
101 xvfb,
102
103=== modified file 'examples/ubuntu-ui-toolkit-gallery/Icons.qml'
104--- examples/ubuntu-ui-toolkit-gallery/Icons.qml 2014-07-31 14:14:56 +0000
105+++ examples/ubuntu-ui-toolkit-gallery/Icons.qml 2014-10-16 12:58:00 +0000
106@@ -79,10 +79,11 @@
107 TemplateRow {
108 title: i18n.tr("Theme")
109 spacing: units.gu(2)
110-
111+ height: iconFlow.height
112
113 Flow {
114- anchors.fill: parent
115+ id: iconFlow
116+ width: parent.width
117 spacing: units.gu(2)
118
119 Repeater {
120
121=== modified file 'examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml'
122--- examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml 2014-08-07 10:28:01 +0000
123+++ examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml 2014-10-16 12:58:00 +0000
124@@ -33,7 +33,7 @@
125 text: templateRow.title
126 width: templateRow.titleWidth
127 anchors.left: parent.left
128- anchors.verticalCenter: contentRow.verticalCenter
129+ anchors.top: contentRow.top
130 elide: Text.ElideRight
131 font.weight: Font.Light
132 }
133
134=== modified file 'examples/ubuntu-ui-toolkit-gallery/TextInputs.qml'
135--- examples/ubuntu-ui-toolkit-gallery/TextInputs.qml 2014-09-17 15:11:08 +0000
136+++ examples/ubuntu-ui-toolkit-gallery/TextInputs.qml 2014-10-16 12:58:00 +0000
137@@ -74,10 +74,22 @@
138 }
139
140 TemplateRow {
141+ title: i18n.tr("Read-only")
142+
143+ TextField {
144+ objectName: "textfield_read_only"
145+ text: i18n.tr("Nobody type here")
146+ readOnly: true
147+ width: parent.width
148+ }
149+ }
150+
151+ TemplateRow {
152 title: i18n.tr("Disabled")
153
154 TextField {
155 objectName: "textfield_disabled"
156+ text: i18n.tr("No interaction allowed")
157 enabled: false
158 width: parent.width
159 }
160
161=== modified file 'modules/Ubuntu/Components/Icon10.qml'
162--- modules/Ubuntu/Components/Icon10.qml 2014-09-19 13:22:18 +0000
163+++ modules/Ubuntu/Components/Icon10.qml 2014-10-16 12:58:00 +0000
164@@ -31,45 +31,27 @@
165 */
166 property alias keyColor: colorizedImage.keyColorIn
167
168+ implicitWidth: image.implicitWidth
169+ implicitHeight: image.implicitHeight
170+
171 Image {
172 id: image
173 objectName: "image"
174 anchors.fill: parent
175+ fillMode: Image.PreserveAspectFit
176
177- /* Necessary so that icons are not loaded before a size is set. */
178- source: ""
179 sourceSize {
180- width: 0
181- height: 0
182- }
183-
184- Component.onCompleted: update()
185- onWidthChanged: update()
186- onHeightChanged: update()
187- Connections {
188- target: icon
189- ignoreUnknownSignals: true
190- onNameChanged: image.update()
191- onSourceChanged: image.update()
192- }
193-
194- function update() {
195- // only set sourceSize.width, sourceSize.height and source when
196- // icon dimensions are valid, see bug #1349769.
197- if (width > 0 && height > 0
198- && (icon.name || (icon.hasOwnProperty("source") && icon.source))) {
199- sourceSize.width = width;
200- sourceSize.height = height;
201- if (icon.hasOwnProperty("source")) {
202- source = icon.source;
203- } else {
204- source = "image://theme/%1".arg(icon.name);
205- }
206- } else {
207- source = "";
208- sourceSize.width = 0;
209- sourceSize.height = 0;
210- }
211+ width: icon.width
212+ height: icon.height
213+ }
214+
215+ source: {
216+ if (icon.hasOwnProperty("source"))
217+ return icon.source;
218+ else if (icon.name)
219+ return "image://theme/%1".arg(icon.name);
220+ else
221+ return "";
222 }
223
224 cache: true
225
226=== modified file 'modules/Ubuntu/Components/ListItems/Empty.qml'
227--- modules/Ubuntu/Components/ListItems/Empty.qml 2014-09-09 16:03:39 +0000
228+++ modules/Ubuntu/Components/ListItems/Empty.qml 2014-10-16 12:58:00 +0000
229@@ -410,7 +410,7 @@
230 width: units.gu(5)
231 }
232 Label {
233- text: i18n.dtr('ubuntu-ui-toolkit', 'Delete')
234+ text: i18n.dtr('ubuntu-ui-toolkit', "Delete")
235 verticalAlignment: Text.AlignVCenter
236 anchors {
237 verticalCenter: parent.verticalCenter
238
239=== modified file 'modules/Ubuntu/Components/OrientationHelper.qml'
240--- modules/Ubuntu/Components/OrientationHelper.qml 2014-07-10 11:50:13 +0000
241+++ modules/Ubuntu/Components/OrientationHelper.qml 2014-10-16 12:58:00 +0000
242@@ -134,7 +134,10 @@
243 window.contentOrientation = Screen.orientation
244 }
245
246- onWindowActiveChanged: applyOrientation()
247+ onWindowActiveChanged: {
248+ if (automaticOrientation)
249+ applyOrientation();
250+ }
251
252 state: orientationAngle.toString()
253
254
255=== modified file 'modules/Ubuntu/Components/Popups/Dialog.qml'
256--- modules/Ubuntu/Components/Popups/Dialog.qml 2014-10-01 10:21:28 +0000
257+++ modules/Ubuntu/Components/Popups/Dialog.qml 2014-10-16 12:58:00 +0000
258@@ -173,43 +173,46 @@
259
260 height: Math.min(contentsColumn.height + foreground.margins, dialog.height)
261
262- Column {
263- id: contentsColumn
264- anchors {
265- top: parent.top
266- left: parent.left
267- right: parent.right
268- margins: foreground.margins
269- }
270- spacing: foreground.itemSpacing
271- height: childrenRect.height + foreground.margins
272- onWidthChanged: updateChildrenWidths();
273-
274- Label {
275- horizontalAlignment: Text.AlignHCenter
276- text: dialog.title
277- wrapMode: Text.Wrap
278- maximumLineCount: 2
279- elide: Text.ElideRight
280- fontSize: "large"
281- color: UbuntuColors.darkGrey
282- visible: (text !== "")
283- }
284-
285- Label {
286- horizontalAlignment: Text.AlignHCenter
287- text: dialog.text
288- fontSize: "medium"
289- color: UbuntuColors.darkGrey
290- wrapMode: Text.Wrap
291- visible: (text !== "")
292- }
293-
294- onChildrenChanged: updateChildrenWidths()
295-
296- function updateChildrenWidths() {
297- for (var i = 0; i < children.length; i++) {
298- children[i].width = contentsColumn.width;
299+ Flickable {
300+ anchors.fill: parent
301+ anchors.margins: foreground.margins
302+ contentWidth: contentsColumn.width
303+ contentHeight: contentsColumn.height - foreground.margins
304+ boundsBehavior: Flickable.StopAtBounds
305+
306+ Column {
307+ id: contentsColumn
308+ spacing: foreground.itemSpacing
309+ width: foreground.width - foreground.margins * 2 - foreground.itemSpacing
310+ height: childrenRect.height + foreground.margins
311+ onWidthChanged: updateChildrenWidths();
312+
313+ Label {
314+ horizontalAlignment: Text.AlignHCenter
315+ text: dialog.title
316+ wrapMode: Text.Wrap
317+ maximumLineCount: 2
318+ elide: Text.ElideRight
319+ fontSize: "large"
320+ color: UbuntuColors.darkGrey
321+ visible: (text !== "")
322+ }
323+
324+ Label {
325+ horizontalAlignment: Text.AlignHCenter
326+ text: dialog.text
327+ fontSize: "medium"
328+ color: UbuntuColors.darkGrey
329+ wrapMode: Text.Wrap
330+ visible: (text !== "")
331+ }
332+
333+ onChildrenChanged: updateChildrenWidths()
334+
335+ function updateChildrenWidths() {
336+ for (var i = 0; i < children.length; i++) {
337+ children[i].width = contentsColumn.width;
338+ }
339 }
340 }
341 }
342
343=== modified file 'modules/Ubuntu/Components/TextArea.qml'
344--- modules/Ubuntu/Components/TextArea.qml 2014-07-11 15:11:02 +0000
345+++ modules/Ubuntu/Components/TextArea.qml 2014-10-16 12:58:00 +0000
346@@ -776,6 +776,8 @@
347 // grab Enter/Return keys which may be stolen from parent components of TextArea
348 // due to forwarded keys from TextEdit
349 Keys.onPressed: {
350+ if (readOnly)
351+ return;
352 if ((event.key === Qt.Key_Enter) || (event.key === Qt.Key_Return)) {
353 if (editor.textFormat === TextEdit.RichText) {
354 // FIXME: use control.paste("<br />") instead when paste() gets sich text support
355
356=== modified file 'modules/Ubuntu/Components/TextCursor.qml'
357--- modules/Ubuntu/Components/TextCursor.qml 2014-09-19 09:07:48 +0000
358+++ modules/Ubuntu/Components/TextCursor.qml 2014-10-16 12:58:00 +0000
359@@ -129,6 +129,7 @@
360 }
361 property bool typing: false
362 property bool contextMenuVisible: false
363+ property bool readOnly: handler.main.readOnly
364 function contextMenuHidden(p) {
365 contextMenuVisible = false
366 }
367
368=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
369--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-10-14 14:33:50 +0000
370+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-10-16 12:58:00 +0000
371@@ -540,6 +540,7 @@
372 verticalCenterOffset: units.dp(-1)
373 left: actionIcon.right
374 leftMargin: units.gu(2)
375+ right: parent.right
376 }
377 fontSize: "small"
378 elide: Text.ElideRight
379
380=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml'
381--- modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml 2014-09-18 15:42:37 +0000
382+++ modules/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml 2014-10-16 12:58:00 +0000
383@@ -61,6 +61,7 @@
384 onErrorChanged: (error) ? visuals.errorColor : visuals.backgroundColor;
385 color: visuals.backgroundColor;
386 anchors.fill: parent
387+ visible: !styledItem.readOnly
388 }
389
390 Loader {
391
392=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml'
393--- modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-09-22 07:19:56 +0000
394+++ modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-10-16 12:58:00 +0000
395@@ -63,6 +63,7 @@
396 running: (cursorStyle.cursorVisibleTimeout > 0) &&
397 (cursorStyle.cursorHiddenTimeout > 0) &&
398 styledItem.visible &&
399+ !styledItem.readOnly &&
400 !styledItem.contextMenuVisible &&
401 styledItem.positionProperty === "cursorPosition"
402 repeat: true
403
404=== modified file 'modules/Ubuntu/Components/ToolbarItems.qml'
405--- modules/Ubuntu/Components/ToolbarItems.qml 2014-05-23 09:27:57 +0000
406+++ modules/Ubuntu/Components/ToolbarItems.qml 2014-10-16 12:58:00 +0000
407@@ -139,7 +139,7 @@
408 property Item back: ToolbarButton {
409 objectName: "back_toolbar_button"
410 iconSource: Qt.resolvedUrl("artwork/back.png")
411- text: i18n.dtr('ubuntu-ui-toolkit', 'Back')
412+ text: i18n.dtr('ubuntu-ui-toolkit', "Back")
413 visible: toolbarItems.pageStack && toolbarItems.pageStack.depth > 1
414 /*!
415 If there is a \l PageStack of sufficient depth, triggering the back button
416
417=== modified file 'modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp'
418--- modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-09-25 08:19:55 +0000
419+++ modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-10-16 12:58:00 +0000
420@@ -25,6 +25,7 @@
421
422 #include <QtCore/QFile>
423 #include <QtCore/QDir>
424+#include <QtCore/QTimeZone>
425 #include <QtCore/QStandardPaths>
426 #include <QtCore/QJsonDocument>
427 #include <QtCore/QJsonObject>
428@@ -127,7 +128,7 @@
429
430 AlarmData alarm;
431 alarm.message = object["message"].toString();
432- alarm.originalDate = alarm.date = AlarmData::transcodeDate(QDateTime::fromString(object["date"].toString()), Qt::LocalTime);
433+ alarm.originalDate = alarm.date = QDateTime::fromString(object["date"].toString());
434 alarm.sound = object["sound"].toString();
435 alarm.type = static_cast<UCAlarm::AlarmType>(object["type"].toInt());
436 alarm.days = static_cast<UCAlarm::DaysOfWeek>(object["days"].toInt());
437@@ -158,7 +159,7 @@
438 Q_FOREACH(const AlarmData &alarm, alarmList) {
439 QJsonObject object;
440 object["message"] = alarm.message;
441- object["date"] = AlarmData::transcodeDate(alarm.originalDate, Qt::UTC).toString();
442+ object["date"] = alarm.originalDate.toString();
443 object["sound"] = alarm.sound.toString();
444 object["type"] = QJsonValue(alarm.type);
445 object["days"] = QJsonValue(alarm.days);
446@@ -181,7 +182,12 @@
447 event.setCollectionId(collection.id());
448 event.setAllDay(false);
449 if (alarm.changes & AlarmData::Date) {
450- event.setStartDateTime(AlarmData::transcodeDate(alarm.date, Qt::UTC));
451+ QDateTime dt = AlarmData::normalizeDate(alarm.date);
452+ // use invalid timezone to sinalize floating time, this is valid only for EDS backend
453+ if (manager->managerName() == ALARM_MANAGER) {
454+ dt = QDateTime(dt.date(), dt.time(), QTimeZone());
455+ }
456+ event.setStartDateTime(dt);
457 }
458 if (alarm.changes & AlarmData::Message) {
459 event.setDisplayLabel(alarm.message);
460@@ -195,7 +201,11 @@
461 event.saveDetail(&visual);
462 }
463 QOrganizerItemAudibleReminder audible = event.detail(QOrganizerItemDetail::TypeAudibleReminder);
464- if (audible.isEmpty()) {
465+ if (audible.dataUrl() != alarm.sound) {
466+ if (!audible.isEmpty()) {
467+ // remove previous attachment
468+ event.removeDetail(&audible);
469+ }
470 audible.setSecondsBeforeStart(0);
471 audible.setDataUrl(alarm.sound);
472 event.saveDetail(&audible);
473@@ -213,20 +223,6 @@
474 }
475 }
476
477- // save the sound as description as the audible reminder may be off
478- if (alarm.changes && AlarmData::Sound) {
479- event.setDescription(alarm.sound.toString());
480- // update audible reminder as well if alarm is enabled
481- if (alarm.enabled) {
482- QOrganizerItemAudibleReminder audible = event.detail(QOrganizerItemDetail::TypeAudibleReminder);
483- // remove the previous data, otherwise we will have two melodies
484- event.removeDetail(&audible);
485- // update sound and save
486- audible.setDataUrl(alarm.sound);
487- event.saveDetail(&audible);
488- }
489- }
490-
491 // set repeating, reset recurrence no matter if we had it or not
492 if (((alarm.changes & AlarmData::Type) == AlarmData::Type)
493 || ((alarm.changes & AlarmData::Days) == AlarmData::Days)) {
494@@ -261,8 +257,9 @@
495
496 alarm.cookie = QVariant::fromValue<QOrganizerItemId>(event.id());
497 alarm.message = event.displayLabel();
498- alarm.date = AlarmData::transcodeDate(event.startDateTime().toUTC(), Qt::LocalTime);
499- alarm.sound = QUrl(event.description());
500+ alarm.date = AlarmData::transcodeDate(event.startDateTime(), Qt::LocalTime);
501+ QOrganizerItemAudibleReminder audible = event.detail(QOrganizerItemDetail::TypeAudibleReminder);
502+ alarm.sound = audible.dataUrl();
503 alarm.originalDate = alarm.date;
504
505 // check if the alarm is enabled or not
506@@ -341,13 +338,6 @@
507 if (value.toBool()) {
508 return !todo.tags().contains(tagDisabledAlarm) && todo.tags().contains(tagAlarmService);
509 } else {
510- // check if we have the attachments still
511- QOrganizerItemVisualReminder visual = todo.detail(QOrganizerItemDetail::TypeVisualReminder);
512- QOrganizerItemAudibleReminder audible = todo.detail(QOrganizerItemDetail::TypeAudibleReminder);
513- if (visual.isEmpty() || audible.isEmpty()) {
514- // we don't, return failure
515- return false;
516- }
517 return todo.tags().contains(tagDisabledAlarm) && todo.tags().contains(tagAlarmService);
518 }
519 }
520@@ -361,14 +351,9 @@
521 }
522 case AlarmData::Sound:
523 {
524- // it is enough to check teh audible presence, as they are added/removed in pair with visual reminder
525+ // it is enough to check the audible presence, as they are added/removed in pair with visual reminder
526 QOrganizerItemAudibleReminder audible = todo.detail(QOrganizerItemDetail::TypeAudibleReminder);
527- bool result = todo.description() == value.toString();
528- if (result && !audible.isEmpty()) {
529- // check whether the reminder has the same sound
530- result = audible.dataUrl().toString() == value.toString();
531- }
532- return result;
533+ return audible.dataUrl().toString() == value.toString();
534 }
535 case AlarmData::Type:
536 {
537@@ -415,7 +400,14 @@
538 return adapter->fetch();
539 }
540
541-void AlarmsAdapter::updateAlarms(QList<QOrganizerItemId> list)
542+bool AlarmsAdapter::compareCookies(const QVariant &cookie1, const QVariant &cookie2)
543+{
544+ QOrganizerItemId id1 = cookie1.value<QOrganizerItemId>();
545+ QOrganizerItemId id2 = cookie2.value<QOrganizerItemId>();
546+ return id1 == id2;
547+}
548+
549+void AlarmsAdapter::updateAlarms(const QList<QOrganizerItemId> &list)
550 {
551 if (list.size() < 0) {
552 return;
553@@ -443,7 +435,8 @@
554 QVariant cookie = QVariant::fromValue<QOrganizerItemId>(event.id());
555 int index = alarmList.indexOfAlarm(cookie);
556 if (index < 0) {
557- qFatal("The Alarm data has been updated with an unregistered item!");
558+ qCritical("The Alarm data has been updated with an unregistered item, skipping!");
559+ continue;
560 }
561 AlarmData data = alarmList[index];
562 if (alarmDataFromOrganizerEvent(event, data) == UCAlarm::NoError) {
563@@ -512,10 +505,6 @@
564 endDate = startDate.addDays(8);
565 }
566
567- // transcode both dates
568- startDate = AlarmData::transcodeDate(startDate, Qt::UTC);
569- endDate = AlarmData::transcodeDate(endDate, Qt::UTC);
570-
571 QList<QOrganizerItem> occurrences = manager->itemOccurrences(event, startDate, endDate, 10);
572 // get the first occurrence and use the date from it
573 if ((occurrences.length() > 0) && (occurrences[0].type() == QOrganizerItemType::TypeTodoOccurrence)) {
574@@ -525,7 +514,7 @@
575 // check if the date is after the current datetime
576 // the first occurrence is the one closest to the currentDate, therefore we can safely
577 // set that startDate to the alarm
578- alarm.date = AlarmData::transcodeDate(occurrence.startDateTime().toUTC(), Qt::LocalTime);
579+ alarm.date = AlarmData::transcodeDate(occurrence.startDateTime(), Qt::LocalTime);
580 if (alarm.date > currentDate) {
581 // we have the proper date set, leave
582 break;
583@@ -587,13 +576,9 @@
584 return false;
585 }
586
587- QOrganizerTodo event;
588- AlarmsAdapter::get()->organizerEventFromAlarmData(alarm, event);
589- event.setId(alarm.cookie.value<QOrganizerItemId>());
590-
591- QOrganizerItemRemoveRequest *operation = new QOrganizerItemRemoveRequest(q_ptr);
592+ QOrganizerItemRemoveByIdRequest *operation = new QOrganizerItemRemoveByIdRequest(q_ptr);
593 operation->setManager(AlarmsAdapter::get()->manager);
594- operation->setItem(event);
595+ operation->setItemId(alarm.cookie.value<QOrganizerItemId>());
596 AlarmsAdapter::get()->listDirty = true;
597 return start(operation);
598 }
599@@ -644,7 +629,7 @@
600 completed = false;
601 // make sure we are in progress state
602 setStatus(requestTypeToOperation(), AlarmRequest::InProgress);
603- QObject::connect(m_request, SIGNAL(resultsAvailable()), q_ptr, SLOT(_q_updateProgress()));
604+ QObject::connect(m_request, SIGNAL(stateChanged(QOrganizerAbstractRequest::State)), q_ptr, SLOT(_q_updateProgress()));
605 if (m_request->start()) {
606 // check if the request got completed without having the slot called (some engines may do that)
607 if (!completed && m_request->state() >= QOrganizerAbstractRequest::CanceledState) {
608@@ -661,11 +646,11 @@
609 void AlarmRequestAdapter::_q_updateProgress()
610 {
611 completed = true;
612-
613 QOrganizerAbstractRequest::State state = m_request->state();
614 AlarmRequest::Operation opCode = requestTypeToOperation();
615 switch (state) {
616 case QOrganizerAbstractRequest::InactiveState: {
617+ completed = false;
618 setStatus(opCode, AlarmRequest::Ready);
619 break;
620 }
621@@ -730,7 +715,7 @@
622 case QOrganizerAbstractRequest::ItemSaveRequest: {
623 return AlarmRequest::Saving;
624 }
625- case QOrganizerAbstractRequest::ItemRemoveRequest: {
626+ case QOrganizerAbstractRequest::ItemRemoveByIdRequest: {
627 return AlarmRequest::Canceling;
628 }
629 case QOrganizerAbstractRequest::ItemFetchRequest: {
630
631=== modified file 'modules/Ubuntu/Components/plugin/adapters/alarmsadapter_p.h'
632--- modules/Ubuntu/Components/plugin/adapters/alarmsadapter_p.h 2014-09-04 13:47:03 +0000
633+++ modules/Ubuntu/Components/plugin/adapters/alarmsadapter_p.h 2014-10-16 12:58:00 +0000
634@@ -90,10 +90,11 @@
635 void daysFromSet(AlarmData &alarm, QSet<Qt::DayOfWeek> set);
636
637 bool verifyChange(const QVariant &cookie, AlarmData::Change change, const QVariant &value);
638+ bool compareCookies(const QVariant &cookie1, const QVariant &cookie2);
639
640 public Q_SLOTS:
641 bool fetchAlarms();
642- void updateAlarms(QList<QOrganizerItemId> list);
643+ void updateAlarms(const QList<QOrganizerItemId> &list);
644
645 protected:
646 AlarmRequest *fetchRequest;
647
648=== modified file 'modules/Ubuntu/Components/plugin/alarmmanager_p.cpp'
649--- modules/Ubuntu/Components/plugin/alarmmanager_p.cpp 2014-09-04 13:47:03 +0000
650+++ modules/Ubuntu/Components/plugin/alarmmanager_p.cpp 2014-10-16 12:58:00 +0000
651@@ -66,5 +66,10 @@
652 return d->verifyChange(pAlarm->rawData.cookie, change, newData);
653 }
654
655+bool AlarmManager::compareCookies(const QVariant &cookie1, const QVariant &cookie2)
656+{
657+ Q_D(AlarmManager);
658+ return d->compareCookies(cookie1, cookie2);
659+}
660
661 #include "moc_alarmmanager_p.cpp"
662
663=== modified file 'modules/Ubuntu/Components/plugin/alarmmanager_p.h'
664--- modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-09-04 13:47:03 +0000
665+++ modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-10-16 12:58:00 +0000
666@@ -123,26 +123,9 @@
667 bool enabled;
668 };
669
670-// list of alarms
671-class AlarmList: public QList<AlarmData>
672-{
673-public:
674- AlarmList(){}
675-
676- // returns the index of the alarm matching a cookie, -1 on error
677- inline int indexOfAlarm(const QVariant &cookie)
678- {
679- for (int i = 0; i < size(); i++) {
680- if (at(i).cookie == cookie) {
681- return i;
682- }
683- }
684- return -1;
685- }
686-};
687-
688 class AlarmRequest;
689 class AlarmManagerPrivate;
690+class AlarmList;
691 class AlarmManager : public QObject
692 {
693 Q_OBJECT
694@@ -160,6 +143,7 @@
695 AlarmList alarms() const;
696
697 bool verifyChange(UCAlarm *alarm, AlarmData::Change change, const QVariant &newData);
698+ bool compareCookies(const QVariant &cookie1, const QVariant &cookie2);
699
700 Q_SIGNALS:
701 void alarmsChanged();
702@@ -172,4 +156,22 @@
703 QScopedPointer<AlarmManagerPrivate> d_ptr;
704 };
705
706+// list of alarms
707+class AlarmList: public QList<AlarmData>
708+{
709+public:
710+ AlarmList(){}
711+
712+ // returns the index of the alarm matching a cookie, -1 on error
713+ inline int indexOfAlarm(const QVariant &cookie)
714+ {
715+ for (int i = 0; i < size(); i++) {
716+ if (AlarmManager::instance().compareCookies(at(i).cookie, cookie)) {
717+ return i;
718+ }
719+ }
720+ return -1;
721+ }
722+};
723+
724 #endif // ALARMMANAGER_H
725
726=== modified file 'modules/Ubuntu/Components/plugin/alarmmanager_p_p.h'
727--- modules/Ubuntu/Components/plugin/alarmmanager_p_p.h 2014-09-04 13:47:03 +0000
728+++ modules/Ubuntu/Components/plugin/alarmmanager_p_p.h 2014-10-16 12:58:00 +0000
729@@ -44,6 +44,8 @@
730
731 virtual bool fetchAlarms() = 0;
732
733+ virtual bool compareCookies(const QVariant &cookie1, const QVariant &cookie2) = 0;
734+
735 // function to verify whether the given alarm property has a given value set
736 // used for testing purposes
737 virtual bool verifyChange(const QVariant &cookie, AlarmData::Change change, const QVariant &value) = 0;
738
739=== modified file 'modules/Ubuntu/Components/plugin/plugin.cpp'
740--- modules/Ubuntu/Components/plugin/plugin.cpp 2014-09-07 16:42:47 +0000
741+++ modules/Ubuntu/Components/plugin/plugin.cpp 2014-10-16 12:58:00 +0000
742@@ -35,7 +35,6 @@
743 #include "inversemouseareatype.h"
744 #include "qquickclipboard.h"
745 #include "qquickmimedata.h"
746-#include "thumbnailgenerator.h"
747 #include "ucubuntuanimation.h"
748 #include "ucfontutils.h"
749 #include "ucarguments.h"
750@@ -214,12 +213,6 @@
751 // register icon provider
752 engine->addImageProvider(QLatin1String("theme"), new UnityThemeIconProvider);
753
754- try {
755- engine->addImageProvider(QLatin1String("thumbnailer"), new ThumbnailGenerator);
756- } catch(std::runtime_error &e) {
757- qDebug() << "Could not create thumbnailer: " << e.what();
758- }
759-
760 // Necessary for Screen.orientation (from import QtQuick.Window 2.0) to work
761 QGuiApplication::primaryScreen()->setOrientationUpdateMask(
762 Qt::PortraitOrientation |
763
764=== modified file 'modules/Ubuntu/Components/plugin/plugin.pro'
765--- modules/Ubuntu/Components/plugin/plugin.pro 2014-09-07 16:42:47 +0000
766+++ modules/Ubuntu/Components/plugin/plugin.pro 2014-10-16 12:58:00 +0000
767@@ -1,6 +1,6 @@
768 unix {
769 CONFIG += link_pkgconfig
770- PKGCONFIG += gio-2.0 thumbnailer dbus-1 libnih-dbus
771+ PKGCONFIG += gio-2.0 dbus-1 libnih-dbus
772 }
773
774 TEMPLATE = lib
775@@ -50,7 +50,6 @@
776 alarmmanager_p.h \
777 ucalarmmodel.h \
778 unitythemeiconprovider.h \
779- thumbnailgenerator.h \
780 alarmrequest_p.h \
781 alarmrequest_p_p.h \
782 adapters/alarmsadapter_p.h \
783@@ -93,7 +92,6 @@
784 alarmmanager_p.cpp \
785 ucalarmmodel.cpp \
786 unitythemeiconprovider.cpp \
787- thumbnailgenerator.cpp \
788 alarmrequest_p.cpp \
789 ucstatesaver.cpp \
790 sortbehavior.cpp \
791
792=== removed file 'modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp'
793--- modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 2014-05-27 14:07:00 +0000
794+++ modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 1970-01-01 00:00:00 +0000
795@@ -1,87 +0,0 @@
796-/*
797- * Copyright 2013 Canonical Ltd.
798- *
799- * This program is free software; you can redistribute it and/or modify
800- * it under the terms of the GNU Lesser General Public License as published by
801- * the Free Software Foundation; version 3.
802- *
803- * This program is distributed in the hope that it will be useful,
804- * but WITHOUT ANY WARRANTY; without even the implied warranty of
805- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
806- * GNU Lesser General Public License for more details.
807- *
808- * You should have received a copy of the GNU Lesser General Public License
809- * along with this program. If not, see <http://www.gnu.org/licenses/>.
810- *
811- * Authors: Jussi Pakkanen <jussi.pakkanen@canonical.com>
812-*/
813-
814-#include "thumbnailgenerator.h"
815-#include <stdexcept>
816-#include <QDebug>
817-#include <QMimeDatabase>
818-#include <QUrl>
819-
820-const char *DEFAULT_VIDEO_ART = "/usr/share/unity/icons/video_missing.png";
821-const char *DEFAULT_ALBUM_ART = "/usr/share/unity/icons/album_missing.png";
822-
823-ThumbnailGenerator::ThumbnailGenerator() : QQuickImageProvider(QQuickImageProvider::Image,
824- QQmlImageProviderBase::ForceAsynchronousImageLoading) {
825-
826-}
827-
828-QImage ThumbnailGenerator::requestImage(const QString &id, QSize *realSize,
829- const QSize &requestedSize) {
830- /* Allow appending a query string (e.g. ?something=timestamp)
831- * to the id and then ignore it.
832- * This is workaround to force reloading a thumbnail when it has
833- * the same file name on disk but we know the content has changed.
834- * It is necessary because in such a situation the QML image cache
835- * will kick in and this ImageProvider will never get called.
836- * The only "solution" is setting Image.cache = false, but in some
837- * cases we don't want to do that for performance reasons, so this
838- * is the only way around the issue for now. */
839- std::string src_path(QUrl(id).path().toUtf8().data());
840- std::string tgt_path;
841- const int xlarge_cutoff = 512;
842- const int large_cutoff = 256;
843- const int small_cutoff = 128;
844- try {
845- ThumbnailSize desiredSize;
846- if(requestedSize.width() > xlarge_cutoff || requestedSize.height() > xlarge_cutoff) {
847- desiredSize = TN_SIZE_ORIGINAL;
848- } else if(requestedSize.width() > large_cutoff || requestedSize.height() > large_cutoff) {
849- desiredSize = TN_SIZE_XLARGE;
850- } else if(requestedSize.width() > small_cutoff || requestedSize.height() > small_cutoff) {
851- desiredSize = TN_SIZE_LARGE;
852- } else {
853- desiredSize = TN_SIZE_SMALL;
854- }
855- tgt_path = tn.get_thumbnail(src_path, desiredSize);
856- if(!tgt_path.empty()) {
857- QString tgt(tgt_path.c_str());
858- QImage image;
859- image.load(tgt);
860- *realSize = image.size();
861- return image;
862- }
863- } catch(std::runtime_error &e) {
864- qDebug() << "Thumbnail generator failed: " << e.what();
865- }
866- return getFallbackImage(id, realSize, requestedSize);
867-}
868-
869-QImage ThumbnailGenerator::getFallbackImage(const QString &id, QSize *size,
870- const QSize &requestedSize) {
871- Q_UNUSED(requestedSize);
872- QMimeDatabase db;
873- QMimeType mime = db.mimeTypeForFile(id);
874- QImage result;
875- if(mime.name().contains("audio")) {
876- result.load(DEFAULT_ALBUM_ART);
877- } else if(mime.name().contains("video")) {
878- result.load(DEFAULT_VIDEO_ART);
879- }
880- *size = result.size();
881- return result;
882-}
883
884=== removed file 'modules/Ubuntu/Components/plugin/thumbnailgenerator.h'
885--- modules/Ubuntu/Components/plugin/thumbnailgenerator.h 2013-10-10 10:56:22 +0000
886+++ modules/Ubuntu/Components/plugin/thumbnailgenerator.h 1970-01-01 00:00:00 +0000
887@@ -1,36 +0,0 @@
888-/*
889- * Copyright 2013 Canonical Ltd.
890- *
891- * This program is free software; you can redistribute it and/or modify
892- * it under the terms of the GNU Lesser General Public License as published by
893- * the Free Software Foundation; version 3.
894- *
895- * This program is distributed in the hope that it will be useful,
896- * but WITHOUT ANY WARRANTY; without even the implied warranty of
897- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
898- * GNU Lesser General Public License for more details.
899- *
900- * You should have received a copy of the GNU Lesser General Public License
901- * along with this program. If not, see <http://www.gnu.org/licenses/>.
902- *
903- * Authors: Jussi Pakkanen <jussi.pakkanen@canonical.com>
904-*/
905-
906-#ifndef THUMBNAIL_GENERATOR_H
907-#define THUMBNAIL_GENERATOR_H
908-
909-#include <QQuickImageProvider>
910-#include <thumbnailer.h>
911-
912-class ThumbnailGenerator: public QQuickImageProvider
913-{
914-private:
915- Thumbnailer tn;
916-
917-public:
918- ThumbnailGenerator();
919- QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
920- QImage getFallbackImage(const QString &id, QSize *size, const QSize &requestedSize);
921-};
922-
923-#endif
924
925=== modified file 'modules/Ubuntu/Components/plugin/ucactioncontext.h'
926--- modules/Ubuntu/Components/plugin/ucactioncontext.h 2014-09-16 07:49:07 +0000
927+++ modules/Ubuntu/Components/plugin/ucactioncontext.h 2014-10-16 12:58:00 +0000
928@@ -27,6 +27,7 @@
929 class UCActionContext : public QObject, public QQmlParserStatus
930 {
931 Q_OBJECT
932+ Q_INTERFACES(QQmlParserStatus)
933 Q_PROPERTY(QQmlListProperty<QObject> actions READ actions)
934 Q_PROPERTY(bool active MEMBER m_active WRITE setActive NOTIFY activeChanged)
935 Q_CLASSINFO("DefaultProperty", "actions")
936
937=== modified file 'modules/Ubuntu/Components/plugin/ucactionmanager.h'
938--- modules/Ubuntu/Components/plugin/ucactionmanager.h 2014-09-16 07:49:07 +0000
939+++ modules/Ubuntu/Components/plugin/ucactionmanager.h 2014-10-16 12:58:00 +0000
940@@ -26,6 +26,7 @@
941 class UCActionManager : public QObject, public QQmlParserStatus
942 {
943 Q_OBJECT
944+ Q_INTERFACES(QQmlParserStatus)
945 Q_PROPERTY(QQmlListProperty<QObject> actions READ actions)
946 Q_PROPERTY(QQmlListProperty<QObject> localContexts READ localContexts)
947 Q_PROPERTY(UCActionContext *globalContext READ globalContext CONSTANT)
948
949=== modified file 'modules/Ubuntu/Components/plugin/ucscalingimageprovider.cpp'
950--- modules/Ubuntu/Components/plugin/ucscalingimageprovider.cpp 2014-09-18 09:29:49 +0000
951+++ modules/Ubuntu/Components/plugin/ucscalingimageprovider.cpp 2014-10-16 12:58:00 +0000
952@@ -65,7 +65,7 @@
953 }
954 }
955
956- if (constrainedSize.isValid()) {
957+ if (!constrainedSize.isEmpty()) {
958 imageReader.setScaledSize(constrainedSize);
959 } else if (scaledSize != realSize) {
960 imageReader.setScaledSize(scaledSize);
961
962=== modified file 'modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.cpp'
963--- modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.cpp 2014-02-11 17:40:02 +0000
964+++ modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.cpp 2014-10-16 12:58:00 +0000
965@@ -20,14 +20,67 @@
966 #include <QtGui/QOpenGLContext>
967 #include "rendertimer.h"
968
969+#if defined(QT_OPENGL_ES)
970+#include <EGL/egl.h>
971+#include <EGL/eglext.h>
972+#endif
973+
974 #if !defined(GL_TIME_ELAPSED)
975 #define GL_TIME_ELAPSED 0x88BF
976 #endif
977
978+class RenderTimerPrivate
979+{
980+public:
981+
982+ RenderTimerPrivate() :
983+ m_type(RenderTimer::Trivial)
984+ { }
985+
986+ RenderTimer::TimerType m_type;
987+ QElapsedTimer m_trivialTimer;
988+
989+#if defined(QT_OPENGL_ES)
990+ struct {
991+ void (QOPENGLF_APIENTRYP genFencesNV)(GLsizei n, GLuint* fences);
992+ void (QOPENGLF_APIENTRYP deleteFencesNV)(GLsizei n, const GLuint* fences);
993+ void (QOPENGLF_APIENTRYP setFenceNV)(GLuint fence, GLenum condition);
994+ void (QOPENGLF_APIENTRYP finishFenceNV)(GLuint fence);
995+ } m_fenceNV;
996+ GLuint m_fence[2];
997+
998+ struct {
999+ EGLSyncKHR (QOPENGLF_APIENTRYP createSyncKHR)(EGLDisplay dpy, EGLenum type,
1000+ const EGLint* attrib_list);
1001+ EGLBoolean (QOPENGLF_APIENTRYP destroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync);
1002+ EGLint (QOPENGLF_APIENTRYP clientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags,
1003+ EGLTimeKHR timeout);
1004+ } m_fenceSyncKHR;
1005+ EGLSyncKHR m_beforeSync;
1006+#else
1007+ struct {
1008+ void (QOPENGLF_APIENTRYP genQueries)(GLsizei n, GLuint* ids);
1009+ void (QOPENGLF_APIENTRYP deleteQueries)(GLsizei n, const GLuint* ids);
1010+ void (QOPENGLF_APIENTRYP beginQuery)(GLenum target, GLuint id);
1011+ void (QOPENGLF_APIENTRYP endQuery)(GLenum target);
1012+ void (QOPENGLF_APIENTRYP getQueryObjectui64v)(GLuint id, GLenum pname, GLuint64* params);
1013+ void (QOPENGLF_APIENTRYP getQueryObjectui64vExt)(GLuint id, GLenum pname, GLuint64EXT* params);
1014+ void (QOPENGLF_APIENTRYP queryCounter)(GLuint id, GLenum target);
1015+ } m_timerQuery;
1016+ enum { TimerQueryUnavailable, TimerQueryCore, TimerQueryExt } m_timerQueryVersion;
1017+ GLuint m_timer[2];
1018+#endif
1019+};
1020+
1021 RenderTimer::RenderTimer(QObject* parent) :
1022- QObject(parent),
1023- m_type(RenderTimer::Trivial)
1024-{
1025+ QObject(parent)
1026+{
1027+ d_ptr = new RenderTimerPrivate;
1028+}
1029+
1030+RenderTimer::~RenderTimer()
1031+{
1032+ delete d_ptr;
1033 }
1034
1035 bool RenderTimer::isAvailable(TimerType type)
1036@@ -89,132 +142,136 @@
1037
1038 void RenderTimer::setup(TimerType type)
1039 {
1040+ Q_D(RenderTimer);
1041 if (type == RenderTimer::Automatic) {
1042 type = RenderTimer::optimalTimerType();
1043 }
1044
1045- m_type = type;
1046+ d->m_type = type;
1047
1048- if (m_type == RenderTimer::Trivial) {
1049+ if (d->m_type == RenderTimer::Trivial) {
1050 #if defined(QT_OPENGL_ES)
1051- } else if (m_type == RenderTimer::KHRFence) {
1052- m_fenceSyncKHR.createSyncKHR = reinterpret_cast<
1053+ } else if (d->m_type == RenderTimer::KHRFence) {
1054+ d->m_fenceSyncKHR.createSyncKHR = reinterpret_cast<
1055 EGLSyncKHR (QOPENGLF_APIENTRYP)(EGLDisplay, EGLenum, const EGLint*)>(
1056 eglGetProcAddress("eglCreateSyncKHR"));
1057- m_fenceSyncKHR.destroySyncKHR = reinterpret_cast<
1058+ d->m_fenceSyncKHR.destroySyncKHR = reinterpret_cast<
1059 EGLBoolean (QOPENGLF_APIENTRYP)(EGLDisplay, EGLSyncKHR)>(
1060 eglGetProcAddress("eglDestroySyncKHR"));
1061- m_fenceSyncKHR.clientWaitSyncKHR = reinterpret_cast<
1062+ d->m_fenceSyncKHR.clientWaitSyncKHR = reinterpret_cast<
1063 EGLint (QOPENGLF_APIENTRYP)(EGLDisplay, EGLSyncKHR, EGLint, EGLTimeKHR)>(
1064 eglGetProcAddress("eglClientWaitSyncKHR"));
1065
1066- } else if (m_type == RenderTimer::NVFence) {
1067- m_fenceNV.genFencesNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1068+ } else if (d->m_type == RenderTimer::NVFence) {
1069+ d->m_fenceNV.genFencesNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1070 eglGetProcAddress("glGenFencesNV"));
1071- m_fenceNV.deleteFencesNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1072+ d->m_fenceNV.deleteFencesNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1073 eglGetProcAddress("glDeleteFencesNV"));
1074- m_fenceNV.setFenceNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum)>(
1075+ d->m_fenceNV.setFenceNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum)>(
1076 eglGetProcAddress("glSetFenceNV"));
1077- m_fenceNV.finishFenceNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint)>(
1078+ d->m_fenceNV.finishFenceNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint)>(
1079 eglGetProcAddress("glFinishFenceNV"));
1080- m_fenceNV.genFencesNV(2, m_fence);
1081+ d->m_fenceNV.genFencesNV(2, d->m_fence);
1082 #else
1083- } else if (m_type == RenderTimer::ARBTimerQuery) {
1084+ } else if (d->m_type == RenderTimer::ARBTimerQuery) {
1085 QOpenGLContext* context = QOpenGLContext::currentContext();
1086- m_timerQuery.genQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1087+ d->m_timerQuery.genQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1088 context->getProcAddress("glGenQueries"));
1089- m_timerQuery.deleteQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1090+ d->m_timerQuery.deleteQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1091 context->getProcAddress("glDeleteQueries"));
1092- m_timerQuery.getQueryObjectui64v =
1093+ d->m_timerQuery.getQueryObjectui64v =
1094 reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum, GLuint64*)>(
1095 context->getProcAddress("glGetQueryObjectui64v"));
1096- m_timerQuery.queryCounter = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum)>(
1097+ d->m_timerQuery.queryCounter = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum)>(
1098 context->getProcAddress("glQueryCounter"));
1099- m_timerQueryVersion = TimerQueryCore;
1100- m_timerQuery.genQueries(2, m_timer);
1101+ d->m_timerQueryVersion = RenderTimerPrivate::TimerQueryCore;
1102+ d->m_timerQuery.genQueries(2, d->m_timer);
1103
1104- } else if (m_type == RenderTimer::EXTTimerQuery) {
1105+ } else if (d->m_type == RenderTimer::EXTTimerQuery) {
1106 QOpenGLContext* context = QOpenGLContext::currentContext();
1107- m_timerQuery.genQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1108+ d->m_timerQuery.genQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, GLuint*)>(
1109 context->getProcAddress("glGenQueries"));
1110- m_timerQuery.deleteQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1111+ d->m_timerQuery.deleteQueries = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLsizei, const GLuint*)>(
1112 context->getProcAddress("glDeleteQueries"));
1113- m_timerQuery.beginQuery = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLuint)>(
1114+ d->m_timerQuery.beginQuery = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLuint)>(
1115 context->getProcAddress("glBeginQuery"));
1116- m_timerQuery.endQuery = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum)>(
1117+ d->m_timerQuery.endQuery = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum)>(
1118 context->getProcAddress("glEndQuery"));
1119- m_timerQuery.getQueryObjectui64vExt =
1120+ d->m_timerQuery.getQueryObjectui64vExt =
1121 reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint, GLenum, GLuint64EXT*)>(
1122 context->getProcAddress("glGetQueryObjectui64vEXT"));
1123- m_timerQueryVersion = TimerQueryExt;
1124- m_timerQuery.genQueries(1, m_timer);
1125+ d->m_timerQueryVersion = RenderTimerPrivate::TimerQueryExt;
1126+ d->m_timerQuery.genQueries(1, d->m_timer);
1127 #endif
1128 }
1129 }
1130
1131 void RenderTimer::teardown()
1132 {
1133- teardown(m_type);
1134+ teardown(d_ptr->m_type);
1135 }
1136
1137 void RenderTimer::teardown(TimerType type)
1138 {
1139+ Q_D(RenderTimer);
1140 if (type == RenderTimer::Trivial) {
1141 #if defined(QT_OPENGL_ES)
1142 } else if (type == RenderTimer::KHRFence) {
1143- if (m_beforeSync != EGL_NO_SYNC_KHR) {
1144- m_fenceSyncKHR.destroySyncKHR(eglGetCurrentDisplay(), m_beforeSync);
1145+ if (d->m_beforeSync != EGL_NO_SYNC_KHR) {
1146+ d->m_fenceSyncKHR.destroySyncKHR(eglGetCurrentDisplay(), d->m_beforeSync);
1147 }
1148
1149 } else if (type == RenderTimer::NVFence) {
1150- m_fenceNV.deleteFencesNV(2, m_fence);
1151+ d->m_fenceNV.deleteFencesNV(2, d->m_fence);
1152 #else
1153 } else if (type == RenderTimer::ARBTimerQuery) {
1154- m_timerQuery.deleteQueries(2, m_timer);
1155+ d->m_timerQuery.deleteQueries(2, d->m_timer);
1156
1157 } else if (type == RenderTimer::EXTTimerQuery) {
1158- m_timerQuery.deleteQueries(1, m_timer);
1159+ d->m_timerQuery.deleteQueries(1, d->m_timer);
1160 #endif
1161 }
1162 }
1163
1164 void RenderTimer::start()
1165 {
1166- if (m_type == RenderTimer::Trivial) {
1167- m_trivialTimer.start();
1168+ Q_D(RenderTimer);
1169+ if (d->m_type == RenderTimer::Trivial) {
1170+ d-> m_trivialTimer.start();
1171 #if defined(QT_OPENGL_ES)
1172- } else if (m_type == RenderTimer::KHRFence) {
1173- m_beforeSync = m_fenceSyncKHR.createSyncKHR(eglGetCurrentDisplay(), EGL_SYNC_FENCE_KHR, NULL);
1174+ } else if (d->m_type == RenderTimer::KHRFence) {
1175+ d->m_beforeSync = d->m_fenceSyncKHR.createSyncKHR(eglGetCurrentDisplay(), EGL_SYNC_FENCE_KHR, NULL);
1176
1177- } else if (m_type == RenderTimer::NVFence) {
1178- m_fenceNV.setFenceNV(m_fence[0], GL_ALL_COMPLETED_NV);
1179+ } else if (d->m_type == RenderTimer::NVFence) {
1180+ d->m_fenceNV.setFenceNV(d->m_fence[0], GL_ALL_COMPLETED_NV);
1181 #else
1182- } else if (m_type == RenderTimer::ARBTimerQuery) {
1183- m_timerQuery.queryCounter(m_timer[0], GL_TIMESTAMP);
1184+ } else if (d->m_type == RenderTimer::ARBTimerQuery) {
1185+ d->m_timerQuery.queryCounter(d->m_timer[0], GL_TIMESTAMP);
1186
1187- } else if (m_type == RenderTimer::EXTTimerQuery) {
1188- m_timerQuery.beginQuery(GL_TIME_ELAPSED, m_timer[0]);
1189+ } else if (d->m_type == RenderTimer::EXTTimerQuery) {
1190+ d->m_timerQuery.beginQuery(GL_TIME_ELAPSED, d->m_timer[0]);
1191 #endif
1192 }
1193 }
1194
1195 qint64 RenderTimer::stop()
1196 {
1197- if (m_type == RenderTimer::Trivial) {
1198+ Q_D(RenderTimer);
1199+ if (d->m_type == RenderTimer::Trivial) {
1200 glFinish();
1201- return m_trivialTimer.nsecsElapsed();
1202+ return d-> m_trivialTimer.nsecsElapsed();
1203 #if defined(QT_OPENGL_ES)
1204- } else if (m_type == RenderTimer::KHRFence) {
1205+ } else if (d->m_type == RenderTimer::KHRFence) {
1206 QElapsedTimer timer;
1207 EGLDisplay dpy = eglGetCurrentDisplay();
1208- EGLSyncKHR afterSync = m_fenceSyncKHR.createSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL);
1209- EGLint beforeSyncValue = m_fenceSyncKHR.clientWaitSyncKHR(dpy, m_beforeSync, 0, EGL_FOREVER_KHR);
1210+ EGLSyncKHR afterSync = d->m_fenceSyncKHR.createSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL);
1211+ EGLint beforeSyncValue = d->m_fenceSyncKHR.clientWaitSyncKHR(dpy, d->m_beforeSync, 0, EGL_FOREVER_KHR);
1212 qint64 beforeTime = timer.nsecsElapsed();
1213- EGLint afterSyncValue = m_fenceSyncKHR.clientWaitSyncKHR(dpy, afterSync, 0, EGL_FOREVER_KHR);
1214+ EGLint afterSyncValue = d->m_fenceSyncKHR.clientWaitSyncKHR(dpy, afterSync, 0, EGL_FOREVER_KHR);
1215 qint64 afterTime = timer.nsecsElapsed();
1216- m_fenceSyncKHR.destroySyncKHR(dpy, afterSync);
1217- m_fenceSyncKHR.destroySyncKHR(dpy, m_beforeSync);
1218- m_beforeSync = EGL_NO_SYNC_KHR;
1219+ d->m_fenceSyncKHR.destroySyncKHR(dpy, afterSync);
1220+ d->m_fenceSyncKHR.destroySyncKHR(dpy, d->m_beforeSync);
1221+ d->m_beforeSync = EGL_NO_SYNC_KHR;
1222 if (beforeSyncValue == EGL_CONDITION_SATISFIED_KHR
1223 && afterSyncValue == EGL_CONDITION_SATISFIED_KHR) {
1224 return afterTime - beforeTime;
1225@@ -222,30 +279,30 @@
1226 return -1;
1227 }
1228
1229- } else if (m_type == RenderTimer::NVFence) {
1230+ } else if (d->m_type == RenderTimer::NVFence) {
1231 QElapsedTimer timer;
1232- m_fenceNV.setFenceNV(m_fence[1], GL_ALL_COMPLETED_NV);
1233- m_fenceNV.finishFenceNV(m_fence[0]);
1234+ d->m_fenceNV.setFenceNV(d->m_fence[1], GL_ALL_COMPLETED_NV);
1235+ d->m_fenceNV.finishFenceNV(d->m_fence[0]);
1236 qint64 beforeTime = timer.nsecsElapsed();
1237- m_fenceNV.finishFenceNV(m_fence[1]);
1238+ d->m_fenceNV.finishFenceNV(d->m_fence[1]);
1239 qint64 afterTime = timer.nsecsElapsed();
1240 return afterTime - beforeTime;
1241 #else
1242- } else if (m_type == RenderTimer::ARBTimerQuery) {
1243+ } else if (d->m_type == RenderTimer::ARBTimerQuery) {
1244 GLuint64 time[2] = { 0, 0 };
1245- m_timerQuery.queryCounter(m_timer[1], GL_TIMESTAMP);
1246- m_timerQuery.getQueryObjectui64v(m_timer[0], GL_QUERY_RESULT, &time[0]);
1247- m_timerQuery.getQueryObjectui64v(m_timer[1], GL_QUERY_RESULT, &time[1]);
1248+ d->m_timerQuery.queryCounter(d->m_timer[1], GL_TIMESTAMP);
1249+ d->m_timerQuery.getQueryObjectui64v(d->m_timer[0], GL_QUERY_RESULT, &time[0]);
1250+ d->m_timerQuery.getQueryObjectui64v(d->m_timer[1], GL_QUERY_RESULT, &time[1]);
1251 if (time[0] != 0 && time[1] != 0) {
1252 return time[1] - time[0];
1253 } else {
1254 return -1;
1255 }
1256
1257- } else if (m_type == RenderTimer::EXTTimerQuery) {
1258+ } else if (d->m_type == RenderTimer::EXTTimerQuery) {
1259 GLuint64EXT time;
1260- m_timerQuery.endQuery(GL_TIME_ELAPSED);
1261- m_timerQuery.getQueryObjectui64vExt(m_timer[0], GL_QUERY_RESULT, &time);
1262+ d->m_timerQuery.endQuery(GL_TIME_ELAPSED);
1263+ d->m_timerQuery.getQueryObjectui64vExt(d->m_timer[0], GL_QUERY_RESULT, &time);
1264 return static_cast<qint64>(time);
1265 #endif
1266 }
1267
1268=== modified file 'modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.h'
1269--- modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.h 2014-02-11 17:40:02 +0000
1270+++ modules/Ubuntu/PerformanceMetrics/plugin/rendertimer.h 2014-10-16 12:58:00 +0000
1271@@ -24,10 +24,7 @@
1272 #include <QtCore/QElapsedTimer>
1273 #include <QtGui/qopenglfunctions.h>
1274
1275-#if defined(QT_OPENGL_ES)
1276-#include <EGL/egl.h>
1277-#include <EGL/eglext.h>
1278-#endif
1279+class RenderTimerPrivate;
1280
1281 class RenderTimer : public QObject
1282 {
1283@@ -49,6 +46,7 @@
1284 };
1285
1286 explicit RenderTimer(QObject* parent = 0);
1287+ virtual ~RenderTimer();
1288
1289 static bool isAvailable(TimerType type);
1290 static TimerType optimalTimerType();
1291@@ -61,39 +59,8 @@
1292 void teardown(TimerType type);
1293
1294 private:
1295- TimerType m_type;
1296- QElapsedTimer m_trivialTimer;
1297-
1298-#if defined(QT_OPENGL_ES)
1299- struct {
1300- void (QOPENGLF_APIENTRYP genFencesNV)(GLsizei n, GLuint* fences);
1301- void (QOPENGLF_APIENTRYP deleteFencesNV)(GLsizei n, const GLuint* fences);
1302- void (QOPENGLF_APIENTRYP setFenceNV)(GLuint fence, GLenum condition);
1303- void (QOPENGLF_APIENTRYP finishFenceNV)(GLuint fence);
1304- } m_fenceNV;
1305- GLuint m_fence[2];
1306-
1307- struct {
1308- EGLSyncKHR (QOPENGLF_APIENTRYP createSyncKHR)(EGLDisplay dpy, EGLenum type,
1309- const EGLint* attrib_list);
1310- EGLBoolean (QOPENGLF_APIENTRYP destroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync);
1311- EGLint (QOPENGLF_APIENTRYP clientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags,
1312- EGLTimeKHR timeout);
1313- } m_fenceSyncKHR;
1314- EGLSyncKHR m_beforeSync;
1315-#else
1316- struct {
1317- void (QOPENGLF_APIENTRYP genQueries)(GLsizei n, GLuint* ids);
1318- void (QOPENGLF_APIENTRYP deleteQueries)(GLsizei n, const GLuint* ids);
1319- void (QOPENGLF_APIENTRYP beginQuery)(GLenum target, GLuint id);
1320- void (QOPENGLF_APIENTRYP endQuery)(GLenum target);
1321- void (QOPENGLF_APIENTRYP getQueryObjectui64v)(GLuint id, GLenum pname, GLuint64* params);
1322- void (QOPENGLF_APIENTRYP getQueryObjectui64vExt)(GLuint id, GLenum pname, GLuint64EXT* params);
1323- void (QOPENGLF_APIENTRYP queryCounter)(GLuint id, GLenum target);
1324- } m_timerQuery;
1325- enum { TimerQueryUnavailable, TimerQueryCore, TimerQueryExt } m_timerQueryVersion;
1326- GLuint m_timer[2];
1327-#endif
1328+ Q_DECLARE_PRIVATE(RenderTimer)
1329+ RenderTimerPrivate *d_ptr;
1330 };
1331
1332 #endif // RENDERTIMER_H
1333
1334=== modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml'
1335--- modules/Ubuntu/Test/UbuntuTestCase.qml 2014-07-15 11:40:02 +0000
1336+++ modules/Ubuntu/Test/UbuntuTestCase.qml 2014-10-16 12:58:00 +0000
1337@@ -101,28 +101,29 @@
1338 return center;
1339 }
1340
1341-
1342-
1343- /*!
1344- Move Mouse from x,y to distance of dx, dy divided to steps with a stepdelay (ms).
1345- */
1346- function mouseMoveSlowly(item,x,y,dx,dy,steps,stepdelay) {
1347- mouseMove(item,x,y);
1348- var step_dx = dx/steps;
1349- var step_dy = dy/steps;
1350-
1351- var ix = 0;
1352- var iy = 0;
1353- for (var step=0; step<steps; step++) {
1354- if (ix<dx) {
1355- ix += step_dx;
1356- }
1357- if (iy<dx) {
1358- iy += step_dy;
1359- }
1360- mouseMove(item,x + ix,y + iy,stepdelay);
1361- }
1362- }
1363+ /*!
1364+ Move Mouse from x,y to distance of dx, dy divided to steps with a stepdelay (ms).
1365+ */
1366+ function mouseMoveSlowly(item,x,y,dx,dy,steps,stepdelay) {
1367+ mouseMove(item, x, y);
1368+ var abs_dx = Math.abs(dx)
1369+ var abs_dy = Math.abs(dy)
1370+ var step_dx = dx / steps;
1371+ var step_dy = dy /steps;
1372+
1373+ var ix = 0;
1374+ var iy = 0;
1375+
1376+ for (var step=0; step < steps; step++) {
1377+ if (ix < abs_dx) {
1378+ ix += step_dx;
1379+ }
1380+ if (iy < abs_dy) {
1381+ iy += step_dy;
1382+ }
1383+ mouseMove(item, x + ix, y + iy, stepdelay);
1384+ }
1385+ }
1386
1387 /*!
1388 \qmlmethod UbuntuTestCase::flick(item, x, y, dx, dy, pressTimeout = -1, steps = -1, button = Qt.LeftButton, modifiers = Qt.NoModifiers, delay = -1)
1389
1390=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py'
1391--- tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 1970-01-01 00:00:00 +0000
1392+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.py 2014-10-16 12:58:00 +0000
1393@@ -0,0 +1,51 @@
1394+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
1395+#
1396+# Copyright (C) 2014 Canonical Ltd.
1397+#
1398+# This program is free software; you can redistribute it and/or modify
1399+# it under the terms of the GNU Lesser General Public License as published by
1400+# the Free Software Foundation; version 3.
1401+#
1402+# This program is distributed in the hope that it will be useful,
1403+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1404+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1405+# GNU Lesser General Public License for more details.
1406+#
1407+# You should have received a copy of the GNU Lesser General Public License
1408+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1409+
1410+"""Tests for the Ubuntu UI Toolkit Header component."""
1411+
1412+import os
1413+
1414+from ubuntuuitoolkit import tests
1415+
1416+
1417+class DialogScrollTestCase(tests.QMLFileAppTestCase):
1418+
1419+ path = os.path.abspath(__file__)
1420+ dir_path = os.path.dirname(path)
1421+ test_qml_file_path = os.path.join(
1422+ dir_path, 'test_popover.qml')
1423+
1424+ def setUp(self):
1425+ super(DialogScrollTestCase, self).setUp()
1426+
1427+ def test_dialog_small(self):
1428+ button = self.main_view.select_single(objectName='button_small')
1429+ self.pointing_device.click_object(button)
1430+ dialog = self.main_view.select_single(objectName='dialog_small')
1431+ flickable = dialog.select_single('QQuickFlickable')
1432+ # There's nothing to reveal
1433+ self.assertTrue(flickable.atYEnd)
1434+
1435+ def test_dialog_scrollable(self):
1436+ button = self.main_view.select_single(objectName='button_huge')
1437+ self.pointing_device.click_object(button)
1438+ dialog = self.main_view.select_single(objectName='dialog_huge')
1439+ flickable = dialog.select_single('QQuickFlickable')
1440+ buttlet = dialog.select_single(objectName='buttlet49')
1441+ # We can scroll
1442+ self.assertFalse(flickable.atYEnd)
1443+ flickable.swipe_child_into_view(buttlet)
1444+ self.assertEqual(flickable.is_child_visible(buttlet), True)
1445
1446=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.qml'
1447--- tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.qml 1970-01-01 00:00:00 +0000
1448+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_popover.qml 2014-10-16 12:58:00 +0000
1449@@ -0,0 +1,70 @@
1450+/*
1451+ * Copyright 2014 Canonical Ltd.
1452+ *
1453+ * This program is free software; you can redistribute it and/or modify
1454+ * it under the terms of the GNU Lesser General Public License as published by
1455+ * the Free Software Foundation; version 3.
1456+ *
1457+ * This program is distributed in the hope that it will be useful,
1458+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1459+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1460+ * GNU Lesser General Public License for more details.
1461+ *
1462+ * You should have received a copy of the GNU Lesser General Public License
1463+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1464+ */
1465+
1466+import QtQuick 2.0
1467+import Ubuntu.Components 1.1
1468+import Ubuntu.Components.Popups 1.0
1469+
1470+MainView {
1471+ width: units.gu(48)
1472+ height: units.gu(60)
1473+
1474+ Page {
1475+ title: "Popover"
1476+
1477+ Column {
1478+ Button {
1479+ objectName: "button_small"
1480+ text: "Small"
1481+ onClicked: PopupUtils.open(smallDialogComponent)
1482+ }
1483+ Button {
1484+ objectName: "button_huge"
1485+ text: "Huge"
1486+ onClicked: PopupUtils.open(hugeDialogComponent)
1487+ }
1488+ }
1489+
1490+ Component {
1491+ id: smallDialogComponent
1492+ Dialog {
1493+ objectName: "dialog_small"
1494+ Column {
1495+ Button {
1496+ text: "Just a button"
1497+ }
1498+ }
1499+ }
1500+ }
1501+
1502+ Component {
1503+ id: hugeDialogComponent
1504+ Dialog {
1505+ objectName: "dialog_huge"
1506+ Column {
1507+ Repeater {
1508+ model: 50
1509+
1510+ Button {
1511+ objectName: "buttlet%1".arg(index)
1512+ text: "Button %1".arg(index)
1513+ }
1514+ }
1515+ }
1516+ }
1517+ }
1518+ }
1519+}
1520
1521=== modified file 'tests/qmlapicheck.py'
1522--- tests/qmlapicheck.py 2014-09-03 10:24:54 +0000
1523+++ tests/qmlapicheck.py 2014-10-16 12:58:00 +0000
1524@@ -84,6 +84,8 @@
1525 def skipversion(filename):
1526 for v in ['10', '11']:
1527 filename = filename.replace(v + '/', '')
1528+ if filename[-8:] == 'qmltypes':
1529+ filename = os.path.basename(filename)
1530 return filename
1531 inputfiles.sort(key=skipversion)
1532
1533@@ -110,7 +112,7 @@
1534 if fileinput.filename() in classes:
1535 classname = ' '.join(classes[fileinput.filename()])
1536 else:
1537- classname = fileinput.filename()
1538+ classname = os.path.basename(fileinput.filename())
1539 print(classname)
1540
1541 line = line.split('//')[0]
1542
1543=== modified file 'tests/qmlapicheck.sh'
1544--- tests/qmlapicheck.sh 2014-09-05 05:49:46 +0000
1545+++ tests/qmlapicheck.sh 2014-10-16 12:58:00 +0000
1546@@ -1,4 +1,4 @@
1547-#!/usr/bin/env sh
1548+#!/usr/bin/env bash
1549 #
1550 # Copyright 2013 Canonical Ltd.
1551 #
1552@@ -15,28 +15,37 @@
1553 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1554 #
1555 ################################################################################
1556+BLDDIR=$1
1557+if [ -z "$BLDDIR" ]; then
1558+ echo "Usage: " $(basename $0) "BUILDFOLDER"
1559+ exit 1
1560+fi
1561+
1562 QML="modules/Ubuntu/*/qmldir modules/Ubuntu/Components/*/qmldir"
1563 CPP="Ubuntu.Components Ubuntu.Layouts Ubuntu.PerformanceMetrics Ubuntu.Test"
1564
1565 echo Dumping QML API of C++ components
1566-echo '' > plugins.qmltypes
1567+echo '' > $BLDDIR/plugins.qmltypes
1568 ERRORS=0
1569 for i in $CPP; do
1570 # Silence spam on stderr due to fonts
1571 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
1572 # https://bugreports.qt-project.org/browse/QTBUG-36243
1573- ALARM_BACKEND=memory qmlplugindump $i 0.1 modules 1>> plugins.qmltypes
1574+ modulePath=${i//./\/}
1575+ pushd "$BLDDIR/../modules/${modulePath}"
1576+ ALARM_BACKEND=memory qmlplugindump $i 0.1 ../../ 1>> $BLDDIR/plugins.qmltypes
1577 test $? != 0 && ERRORS=1
1578+ popd
1579 done
1580 test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 1
1581
1582 echo Running QML API check for $QML
1583 # Palette and UbuntuColors gets included in Qt > 5.2 qmlplugindump even though it's qml
1584-BUILTINS=QQuick,QQml,U1db::,Palette,UbuntuColors python3 tests/qmlapicheck.py $QML plugins.qmltypes > components.api.new
1585+BUILTINS=QQuick,QQml,U1db::,Palette,UbuntuColors python3 tests/qmlapicheck.py $QML $BLDDIR/plugins.qmltypes > $BLDDIR/components.api.new
1586 test $? != 0 && echo Error: qmlapicheck.py failed && exit 1
1587
1588 echo Verifying the diff between existing and generated API
1589-diff -Fqml -u components.api components.api.new
1590+diff -Fqml -u components.api $BLDDIR/components.api.new
1591 test $? != 0 && ERRORS=1
1592
1593 if [ "x$ERRORS" != "x1" ]; then
1594
1595=== modified file 'tests/uitk_test_plan.sh'
1596--- tests/uitk_test_plan.sh 2014-09-22 09:45:35 +0000
1597+++ tests/uitk_test_plan.sh 2014-10-16 12:58:00 +0000
1598@@ -29,40 +29,38 @@
1599 DISTRO="ubuntu-rtm"
1600 SERIES="14.09"
1601 CHANNEL="ubuntu-touch/${DISTRO}/${SERIES}-proposed"
1602-PWD="0000"
1603-BOOTTIME=300
1604+PASSWORD="0000"
1605+BOOTTIME=500
1606+ONLYCOMPARE=false
1607
1608 declare -a TEST_SUITE=(
1609- " -p dialer-app-autopilot dialer_app"
1610+ " -p ubuntu-ui-toolkit-autopilot ubuntuuitoolkit"
1611+ " -p webbrowser-app-autopilot webbrowser_app"
1612+ " -p address-book-app-autopilot address_book_app"
1613+ " sudoku_app"
1614+ " online_accounts_ui"
1615+ " ubuntu_calculator_app"
1616 " -p messaging-app-autopilot messaging_app"
1617- " -p reminders-app-autopilot reminders"
1618- " -p ubuntu-system-settings-autopilot ubuntu_system_settings"
1619- " -p ubuntu-html5-ui-toolkit-autopilot ubuntu_html5_ui_toolkit"
1620- " -p unity-webapps-qml-autopilot unity_webapps_qml"
1621- " -p address-book-app-autopilot address_book_app"
1622+ " -p mediaplayer-app-autopilot mediaplayer_app"
1623 " dropping_letters_app"
1624- " sudoku_app"
1625- " -p ubuntu-ui-toolkit-autopilot ubuntuuitoolkit"
1626- " -p webbrowser-app-autopilot webbrowser_app"
1627+ " -p dialer-app-autopilot dialer_app"
1628+#hangs " -p reminders-app-autopilot reminders"
1629 " shorts_app"
1630 " ubuntu_weather_app"
1631- " online_accounts_ui"
1632+ " -p ubuntu-system-settings-autopilot ubuntu_system_settings"
1633+ " music_app"
1634+ " gallery_app"
1635 " filemanager"
1636- " calendar_app"
1637- " music_app"
1638- " -p mediaplayer-app-autopilot mediaplayer_app"
1639 " ubuntu_terminal_app"
1640+ " -n unity8"
1641 " ubuntu_clock_app"
1642- " ubuntu_calculator_app"
1643- " gallery_app"
1644-# " -n unity8"
1645-# " -p camera-app-autopilot camera_app"
1646 )
1647
1648
1649 UITK_PACKAGES="qtdeclarative5-ubuntu-ui-toolkit-plugin \
1650 ubuntu-ui-toolkit-autopilot \
1651- ubuntu-ui-toolkit-theme"
1652+ ubuntu-ui-toolkit-theme \
1653+ qtorganizer5-eds"
1654
1655 AP_PACKAGES="address-book-service-dummy \
1656 python3-lxml \
1657@@ -86,11 +84,18 @@
1658 i=1
1659 while [ $(adb get-state -s ${SERIALNUMBER}) == "unknown" ]
1660 do
1661- echo -ne "Wait: $i seconds\r"
1662+ echo -ne "Wait for adb: $i seconds\r"
1663 sleep 1
1664 i=$[$i+1]
1665 done
1666 echo -ne '\n'
1667+ until pids=$(adb -s ${SERIALNUMBER} shell pidof unity-system-compositor|egrep -v "^$|initctl:");
1668+ do
1669+ echo -ne "Wait for compositor: $i seconds\r"
1670+ sleep 1;
1671+ i=$[$i+1]
1672+ done;
1673+ echo -ne '\n'
1674 return
1675 fi
1676 SLEEP=$1
1677@@ -113,7 +118,7 @@
1678
1679 function reset {
1680 if [ ${RESET} == true -o x"$1" == x-f ]; then
1681- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S reboot 2>&1|grep -v password"
1682+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S reboot 2>&1|grep -v password"
1683 sleep_indicator 120
1684 /usr/share/qtcreator/ubuntu/scripts/device_wait_for_shell ${SERIALNUMBER} > /dev/null
1685 sleep_indicator 10
1686@@ -122,10 +127,9 @@
1687 adb -s ${SERIALNUMBER} shell powerd-cli display on |egrep -v "Display State requested, cookie is|Press ctrl-c to exit|not fully supported." &
1688 adb -s ${SERIALNUMBER} shell powerd-cli active |egrep -v "requested, cookie is|Press ctrl-c to exit|not fully supported." &
1689 sleep_indicator 10
1690- adb -s ${SERIALNUMBER} shell "sudo -u phablet -i gdbus call --session --dest com.canonical.UnityGreeter \
1691- --object-path / \
1692- --method com.canonical.UnityGreeter.HideGreeter|grep -v '\(\)'"
1693- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S dbus-send --system --print-reply \
1694+ adb -s ${SERIALNUMBER} shell amixer -D pulse set Master 1+ mute 2>&1 > /dev/null
1695+ adb -s ${SERIALNUMBER} shell "gdbus call --session --dest com.canonical.UnityGreeter --object-path / --method com.canonical.UnityGreeter.HideGreeter|grep -v '\(\)'"
1696+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S dbus-send --system --print-reply \
1697 --dest=org.freedesktop.Accounts \
1698 /org/freedesktop/Accounts/User32011 \
1699 org.freedesktop.DBus.Properties.Set \
1700@@ -137,10 +141,10 @@
1701 function device_comission {
1702 adb -s ${SERIALNUMBER} wait-for-device
1703 # Avoid https://bugs.launchpad.net/gallery-app/+bug/1363190
1704- adb -s ${SERIALNUMBER} shell "echo 0000 |sudo -S rm -rf /userdata/user-data/phablet/.cache/com.ubuntu.gallery 2>&1|grep -v password"
1705+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD} |sudo -S rm -rf /userdata/user-data/phablet/.cache/com.ubuntu.gallery 2>&1|grep -v password"
1706 # flash the latest image
1707 echo -e "Flashing \e[31m${CHANNEL}\e[0m"
1708- ubuntu-device-flash --serial=${SERIALNUMBER} --channel=${CHANNEL} --wipe --developer-mode --password=0000
1709+ ubuntu-device-flash --serial=${SERIALNUMBER} --channel=${CHANNEL} --wipe --developer-mode --password=${PASSWORD}
1710 sleep_indicator ${BOOTTIME}
1711 echo -e "Disable the intro wizard"
1712 phablet-config -s ${SERIALNUMBER} welcome-wizard --disable
1713@@ -148,31 +152,33 @@
1714 phablet-config -s ${SERIALNUMBER} edges-intro --disable
1715 echo -e "Clone the network "
1716 network
1717- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S reboot 2>&1|grep -v password"
1718+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S reboot 2>&1|grep -v password"
1719 sleep_indicator 120
1720 echo -e "phablet-click-test-setup \e[31m${DISTRO} ${SERIES}\e[0m"
1721 phablet-click-test-setup -s ${SERIALNUMBER} --distribution=${DISTRO} --series=${SERIES} 2>&1
1722- echo "Sleep after phablet-click-test-setup";sleep_indicator 120
1723+ echo "Sleep after phablet-click-test-setup";
1724+ sleep_indicator 120
1725 if [ ${PPA} == "archive" ]; then
1726 echo "Set up with the archive image"
1727- phablet-config -s ${SERIALNUMBER} writable-image -r 0000 2>&1 > /dev/null
1728- echo "Sleep after phablet-config";sleep_indicator 120
1729+ phablet-config -s ${SERIALNUMBER} writable-image -r ${PASSWORD} 2>&1 > /dev/null
1730+ echo "Sleep after phablet-config";
1731+ sleep_indicator 120
1732 network
1733 else
1734 if [[ "$PPA" =~ ^[0-9]{3}$ ]]; then
1735 echo -e "Set up with the silo \e[31m${PPA}\e[0m"
1736- phablet-config -s ${SERIALNUMBER} writable-image -r 0000 2>&1 > /dev/null
1737+ phablet-config -s ${SERIALNUMBER} writable-image -r ${PASSWORD} 2>&1 > /dev/null
1738 sleep_indicator 120
1739 network
1740- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S bash -c 'echo \"deb http://ppa.launchpad.net/ci-train-ppa-service/landing-${PPA}/${DISTRO} ${SERIES} main\" > /etc/apt/sources.list.d/silo-${PPA}.list'"
1741- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1742+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S bash -c 'echo \"deb http://ppa.launchpad.net/ci-train-ppa-service/landing-${PPA}/${DISTRO} ${SERIES} main\" > /etc/apt/sources.list.d/silo-${PPA}.list'"
1743+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1744 else
1745 echo -e "Set up with the PPA \e[31m${PPA}\e[0m"
1746- phablet-config -s ${SERIALNUMBER} writable-image -r 0000 2>&1 > /dev/null
1747+ phablet-config -s ${SERIALNUMBER} writable-image -r ${PASSWORD} 2>&1 > /dev/null
1748 sleep_indicator 120
1749 network
1750- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S bash -c 'echo \"deb http://ppa.launchpad.net/${PPA}/${DISTRO} ${SERIES} main\" > /etc/apt/sources.list.d/testing-ppa.list'"
1751- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1752+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S bash -c 'echo \"deb http://ppa.launchpad.net/${PPA}/${DISTRO} ${SERIES} main\" > /etc/apt/sources.list.d/testing-ppa.list'"
1753+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1754
1755 fi
1756 fi
1757@@ -180,15 +186,38 @@
1758 UITK_VERSION=`adb -s ${SERIALNUMBER} shell "stty cols 250; dpkg -l"|grep qtdeclarative5-ubuntu-ui-toolkit-plugin|awk '{print $3}'`
1759 echo -e "Original UITK version:\t\e[31m${UITK_VERSION}\e[0m"
1760 echo "Updating APT";
1761- adb -s ${SERIALNUMBER} shell "echo 0000 |sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1762+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD} |sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1763 echo "Install the UITK packages"
1764- adb -s ${SERIALNUMBER} shell "echo 0000|sudo -S apt-get install --yes --force-yes ${UITK_PACKAGES} 2>&1 |grep -v password > /dev/null"
1765+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD}|sudo -S apt-get install --yes --force-yes ${UITK_PACKAGES} 2>&1 |grep -v password > /dev/null"
1766 UITK_VERSION=`adb -s ${SERIALNUMBER} shell "stty cols 250; dpkg -l"|grep qtdeclarative5-ubuntu-ui-toolkit-plugin|awk '{print $3}'`
1767 echo -e "New UITK version:\t\e[31m${UITK_VERSION}\e[0m"
1768 # Update APT
1769- adb -s ${SERIALNUMBER} shell "echo 0000 |sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1770+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD} |sudo -S apt-get update 2>&1|grep -v password > /dev/null"
1771 # Install the autopilot tests for the apps
1772- adb -s ${SERIALNUMBER} shell "echo 0000 |sudo -S apt-get install --yes --force-yes ${AP_PACKAGES} 2>&1 | grep -v password > /dev/null"
1773+ adb -s ${SERIALNUMBER} shell "echo ${PASSWORD} |sudo -S apt-get install --yes --force-yes ${AP_PACKAGES} 2>&1 | grep -v password > /dev/null"
1774+}
1775+
1776+function compare_results {
1777+ sed -i 's/\r//g' *tests
1778+ for RESULT_FILE in *${PPA}.tests;
1779+ do
1780+ echo "$RESULT_FILE";
1781+ LAST_LINE=`tail -1 $RESULT_FILE`
1782+ if [[ "$LAST_LINE" =~ OK || "$LAST_LINE" =~ FAILED ]]; then
1783+ echo -e "\t"`tail -2 $RESULT_FILE`
1784+ else
1785+ echo -e "\t\e[31mBroken tests\e[0m"
1786+ fi
1787+ egrep -v "NO TAGS DATABASE" $RESULT_FILE |egrep "^ERROR:|^FAIL:" | while read -r FAILED ;
1788+ do
1789+ echo -e "\tFailed with ${PPA} - $FAILED"
1790+ if grep --quiet "$FAILED" *archive.tests; then
1791+ echo -e "\tSame on archive"
1792+ else
1793+ echo -e "\t\e[31mPossible regression\e[0m"
1794+ fi
1795+ done
1796+ done
1797 }
1798
1799 while getopts ":hrcintdus:o:p:f:" opt; do
1800@@ -216,6 +245,9 @@
1801 c)
1802 COMISSION=true
1803 ;;
1804+ d)
1805+ ONLYCOMPARE=true
1806+ ;;
1807 n)
1808 DONOTRUNTESTS=true
1809 ;;
1810@@ -227,15 +259,46 @@
1811 ;;
1812 h)
1813 echo "Usage: uitk_test_plan.sh -s [serial number] -m -c"
1814- echo " -r : Reset after each tests. Default: ${RESET}"
1815- echo " -s : Use the device with the given serial number. Default: ${SERIALNUMBER}"
1816- echo " -c : Comission the device with the ${PPA} enabled"
1817- echo " -n : Do not run the test set. Default ${DONOTRUNTESTS}"
1818- echo " -o : Output directory. Default $OUTPUTDIR"
1819- echo " -p : Source PPA for the UITK. Default $PPA. Use -p archive to test stock image or -p [0-9]* to set a silo."
1820- echo " -f : Filter for the test suite. Default $FILTER"
1821- echo " -u : Provision the Development release of Ubuntu. Default is RTM."
1822- exit
1823+ echo -e "\t-r : Reset after each tests. Default: ${RESET}"
1824+ echo -e "\t-s : Use the device with the given serial number. Default: ${SERIALNUMBER}"
1825+ echo -e "\t-c : Comission the device with the ${PPA} enabled"
1826+ echo -e "\t-d : Only compare the -p ${PPA} results with the archive test results. Default: ${ONLYCOMPARE}"
1827+ echo -e "\t-n : Do not run the test set. Default ${DONOTRUNTESTS}"
1828+ echo -e "\t-o : Output directory. Default $OUTPUTDIR"
1829+ echo -e "\t-p : Source PPA for the UITK. Default $PPA. Use -p archive to test stock image or -p [0-9]* to set a silo."
1830+ echo -e "\t-f : Filter for the test suite. Default $FILTER"
1831+ echo -e "\t-u : Provision the Development release of Ubuntu. Default is RTM."
1832+ echo ""
1833+ echo "By default tihe uitk_test_plan.sh flashes the latest RTM image on the device, installs the click application"
1834+ echo "tests, configures the ppa:ubuntu-sdk-team/staging PPA, installs the UITK from the PPA and executes the test plan."
1835+ echo ""
1836+ echo "Validate the staging branch of the UITK against the RTM image"
1837+ echo -e "\t$ ./uitk_test_plan.sh -c"
1838+ echo ""
1839+ echo "Validate the UITK from a CI silo on an RTM image"
1840+ echo -e "\t$ ./uitk_test_plan.sh -c -p 001"
1841+ echo ""
1842+ echo "Validate the UITK from teh archive on an RTM image"
1843+ echo -e "\t$ ./uitk_test_plan.sh -c -p archive"
1844+ echo ""
1845+ echo "Validate the UITK from a specific CI silo on an Ubuntu Utopic image"
1846+ echo -e "\t$ ./uitk_test_plan.sh -c -p 001 -u"
1847+ echo ""
1848+ echo "Provision the device for manual testing with the latest RTM image"
1849+ echo -e "\t$ ./uitk_test_plan.sh -c -p archive -n"
1850+ echo ""
1851+ echo "Provision the device for manual testing with the latest Ubuntu Utopic image"
1852+ echo -e "\t$ ./uitk_test_plan.sh -c -p archive -u -n"
1853+ echo ""
1854+ echo "Run the test plan on an already provisioned device"
1855+ echo -e "\t$ ./uitk_test_plan.sh"
1856+ echo ""
1857+ echo "Run only the UITK tests on an already provisioned device"
1858+ echo -e "\t$ ./uitk_test_plan.sh -f ubuntuuitoolkit"
1859+ echo ""
1860+ echo "Compare the archive test results with the silo 001 results"
1861+ echo -e "\t$ ./uitk_test_plan.sh -d -p 001"
1862+ exit
1863 ;;
1864 :)
1865 echo "Option -$OPTARG requires an argument." >&2
1866@@ -243,6 +306,13 @@
1867 esac
1868 done
1869
1870+if [ ${ONLYCOMPARE} == true ]; then
1871+ echo "Comparing results with the archive tests"
1872+ compare_results
1873+ exit
1874+fi
1875+
1876+
1877 # Use the first available device for testing
1878 if [ ${LAZY} == true ]; then
1879 echo "Waiting for a device"
1880@@ -260,40 +330,35 @@
1881 fi
1882
1883 # Check if the job is only comissioning the device
1884-if [ ${DONOTRUNTESTS} == true ]; then
1885- exit
1886-fi
1887-
1888-# Reset the device for testing
1889-reset -f
1890-
1891-# Run the test suite
1892-for TEST_SET in "${TEST_SUITE[@]}"
1893-do
1894- if [[ ${TEST_SET} =~ ${FILTER} ]]; then
1895- APPNAME=${TEST_SET##* }
1896- LOGFILE="$OUTPUTDIR/${LOGFILENAME}-${APPNAME}-1.tests"
1897- COMMAND="phablet-test-run -s ${SERIALNUMBER} $TEST_SET >> ${LOGFILE}"
1898- echo "<<<=== ${APPNAME} 1 ===>>>" >> ${LOGFILE}
1899- reset
1900- eval ${COMMAND}
1901- egrep "<<<===|Ran|OK|FAILED" ${LOGFILE}
1902- # check if the tests were successful and re-run after a reset
1903-# if grep -q "FAILED" ${LOGFILE}; then
1904-# reset -f
1905-# LOGFILE="$OUTPUTDIR/${LOGFILENAME}-${APPNAME}-2.tests"
1906-# COMMAND="phablet-test-run -s ${SERIALNUMBER} $TEST_SET >> ${LOGFILE}"
1907-# echo "<<<=== ${APPNAME} 2 ===>>>" >> ${LOGFILE}
1908-# eval ${COMMAND}
1909-# egrep "<<<===|Ran|OK|FAILED" ${LOGFILE}
1910-# if grep -q "FAILED" ${LOGFILE}; then
1911-# reset -f
1912-# LOGFILE="$OUTPUTDIR/${LOGFILENAME}-${APPNAME}-3.tests"
1913-# COMMAND="phablet-test-run -s ${SERIALNUMBER} $TEST_SET >> ${LOGFILE}"
1914-# echo "<<<=== ${APPNAME} 3 ===>>>" >> ${LOGFILE}
1915-# eval ${COMMAND}
1916-# egrep "<<<===|Ran|OK|FAILED|FAIL|ERROR:" ${LOGFILE}
1917-# fi
1918-# fi
1919- fi
1920-done
1921+if [ ${DONOTRUNTESTS} != true ]; then
1922+ # Reset the device for testing
1923+ reset -f
1924+
1925+ # Run the test suite
1926+ for TEST_SET in "${TEST_SUITE[@]}"
1927+ do
1928+ if [[ ${TEST_SET} =~ ${FILTER} ]]; then
1929+ APPNAME=${TEST_SET##* }
1930+ LOGFILE="$OUTPUTDIR/${LOGFILENAME}-${APPNAME}-1-${PPA}.tests"
1931+ COMMAND="phablet-test-run -r ${PASSWORD} -s ${SERIALNUMBER} $TEST_SET >> ${LOGFILE}"
1932+ echo "<<<=== ${APPNAME} 1 ===>>>" >> ${LOGFILE}
1933+ reset
1934+ eval ${COMMAND}
1935+ egrep "<<<===|Ran|OK|FAILED" ${LOGFILE}
1936+ # check if the tests were successful and re-run after a reset
1937+ if grep -q "FAILED" ${LOGFILE}; then
1938+ reset -f
1939+ LOGFILE="$OUTPUTDIR/${LOGFILENAME}-${APPNAME}-2-${PPA}.tests"
1940+ COMMAND="phablet-test-run -r ${PASSWORD} -s ${SERIALNUMBER} $TEST_SET >> ${LOGFILE}"
1941+ echo "<<<=== ${APPNAME} 2 ===>>>" >> ${LOGFILE}
1942+ eval ${COMMAND}
1943+ egrep "<<<===|Ran|OK|FAILED" ${LOGFILE}
1944+ fi
1945+ fi
1946+ done
1947+fi
1948+
1949+if [ ${PPA} != "archive" ]; then
1950+ echo "Comparing results with the archive tests"
1951+ compare_results
1952+fi
1953
1954=== modified file 'tests/unit/add_qmlmakecheck.pri'
1955--- tests/unit/add_qmlmakecheck.pri 2014-03-04 12:38:39 +0000
1956+++ tests/unit/add_qmlmakecheck.pri 2014-10-16 12:58:00 +0000
1957@@ -8,5 +8,5 @@
1958 check.commands += ../../unit/runtest.sh $${TARGET} $${TEST} minimal;
1959 }
1960 check.commands += cd ../../..;
1961-check.commands += sh tests/qmlapicheck.sh || exit 1;
1962+check.commands += tests/qmlapicheck.sh $${PWD}/../ || exit 1;
1963 check.commands += cd tests/unit
1964
1965=== modified file 'tests/unit/tst_alarms/tst_alarms.cpp'
1966--- tests/unit/tst_alarms/tst_alarms.cpp 2014-09-25 08:19:55 +0000
1967+++ tests/unit/tst_alarms/tst_alarms.cpp 2014-10-16 12:58:00 +0000
1968@@ -45,6 +45,7 @@
1969 void syncFetch()
1970 {
1971 // initiate fetch
1972+ QSignalSpy spy(&AlarmManager::instance(), SIGNAL(alarmsChanged()));
1973 AlarmsAdapter *adapter = AlarmsAdapter::get();
1974 if (!adapter->fetchRequest) {
1975 adapter->fetchAlarms();
1976@@ -53,9 +54,21 @@
1977 adapter->fetchRequest->wait();
1978 }
1979 QTest::waitForEvents();
1980- }
1981-
1982- void waitForRequest(UCAlarm *alarm)
1983+ spy.wait(200);
1984+ }
1985+
1986+ void waitForUpdate(UCAlarm *alarm)
1987+ {
1988+ QSignalSpy spy(&AlarmManager::instance(), SIGNAL(alarmsUpdated(QList<QVariant>)));
1989+ UCAlarmPrivate *pAlarm = UCAlarmPrivate::get(alarm);
1990+ if (pAlarm->request) {
1991+ pAlarm->request->wait();
1992+ }
1993+ QTest::waitForEvents();
1994+ spy.wait();
1995+ }
1996+
1997+ void waitAndFetch(UCAlarm *alarm)
1998 {
1999 UCAlarmPrivate *pAlarm = UCAlarmPrivate::get(alarm);
2000 if (pAlarm->request) {
2001@@ -136,7 +149,7 @@
2002 UCAlarm *alarm = model.get(i);
2003 if (alarm && alarm->message().startsWith("test_")) {
2004 alarm->cancel();
2005- waitForRequest(alarm);
2006+ waitAndFetch(alarm);
2007 i = 0;
2008 } else {
2009 i++;
2010@@ -153,7 +166,7 @@
2011 void test_singleShotAlarmPass() {
2012 UCAlarm alarm(QDateTime::currentDateTime().addSecs(4), "test_singleShotAlarmPass");
2013 alarm.save();
2014- waitForRequest(&alarm);
2015+ waitAndFetch(&alarm);
2016 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2017 QVERIFY(containsAlarm(&alarm));
2018 }
2019@@ -163,7 +176,7 @@
2020 UCAlarm alarm(QDateTime::currentDateTime().addSecs(20), UCAlarm::AutoDetect, "test_repeating_autoDetect");
2021
2022 alarm.save();
2023- waitForRequest(&alarm);
2024+ waitAndFetch(&alarm);
2025 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2026 QVERIFY(containsAlarm(&alarm));
2027 }
2028@@ -173,7 +186,7 @@
2029 UCAlarm alarm(QDateTime::currentDateTime().addSecs(10), UCAlarm::Daily, "test_repeating_daily");
2030
2031 alarm.save();
2032- waitForRequest(&alarm);
2033+ waitAndFetch(&alarm);
2034 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2035 QVERIFY(containsAlarm(&alarm));
2036 }
2037@@ -199,7 +212,7 @@
2038 UCAlarm alarm(QDateTime::currentDateTime(), (UCAlarm::DaysOfWeek)day, "test_repeating_givenDay_exact_" + message);
2039
2040 alarm.save();
2041- waitForRequest(&alarm);
2042+ waitAndFetch(&alarm);
2043 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2044 QVERIFY(containsAlarm(&alarm));
2045 }
2046@@ -232,7 +245,7 @@
2047 UCAlarmPrivate::get(&firstOccurrence)->checkAlarm();
2048
2049 alarm.save();
2050- waitForRequest(&alarm);
2051+ waitAndFetch(&alarm);
2052 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2053 QVERIFY(containsAlarm(&alarm));
2054 QVERIFY(containsAlarm(&firstOccurrence));
2055@@ -257,7 +270,7 @@
2056
2057 UCAlarm alarm(QDateTime::currentDateTime().addSecs(3600), (UCAlarm::DaysOfWeek)dow, "test_repeating_weekly_" + message);
2058 alarm.save();
2059- waitForRequest(&alarm);
2060+ waitAndFetch(&alarm);
2061 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2062 QVERIFY(containsAlarm(&alarm));
2063 }
2064@@ -291,12 +304,12 @@
2065 UCAlarm alarm(QDateTime::currentDateTime().addDays(1), "test_cancelPass");
2066
2067 alarm.save();
2068- waitForRequest(&alarm);
2069+ waitAndFetch(&alarm);
2070 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2071 QVERIFY(containsAlarm(&alarm));
2072
2073 alarm.cancel();
2074- waitForRequest(&alarm);
2075+ waitAndFetch(&alarm);
2076 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2077 QVERIFY(!containsAlarm(&alarm));
2078 }
2079@@ -308,9 +321,9 @@
2080 UCAlarm alarm2(dt, "test_twoAlarmsOnSameTime");
2081
2082 alarm1.save();
2083- waitForRequest(&alarm1);
2084+ waitAndFetch(&alarm1);
2085 alarm2.save();
2086- waitForRequest(&alarm2);
2087+ waitAndFetch(&alarm2);
2088 QCOMPARE(alarm1.error(), (int)UCAlarm::NoError);
2089 QCOMPARE(alarm2.error(), (int)UCAlarm::NoError);
2090 }
2091@@ -322,9 +335,9 @@
2092 UCAlarm alarm2(dt, UCAlarm::Daily, "test_twoAlarmsOnSameTime2");
2093
2094 alarm1.save();
2095- waitForRequest(&alarm1);
2096+ waitAndFetch(&alarm1);
2097 alarm2.save();
2098- waitForRequest(&alarm2);
2099+ waitAndFetch(&alarm2);
2100 QCOMPARE(alarm1.error(), (int)UCAlarm::NoError);
2101 QCOMPARE(alarm2.error(), (int)UCAlarm::NoError);
2102 }
2103@@ -336,7 +349,7 @@
2104 UCAlarm copy(dt, "test_updateAlarm_SameType");
2105
2106 alarm.save();
2107- waitForRequest(&alarm);
2108+ waitAndFetch(&alarm);
2109 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2110 QVERIFY(containsAlarm(&alarm));
2111
2112@@ -344,7 +357,8 @@
2113 QVERIFY(!compareAlarms(&alarm, &copy));
2114
2115 alarm.save();
2116- waitForRequest(&alarm);
2117+ // do not fetch!
2118+ waitForUpdate(&alarm);
2119 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2120 QVERIFY(containsAlarm(&alarm));
2121 QVERIFY(!containsAlarm(&copy));
2122@@ -357,14 +371,15 @@
2123 UCAlarm copy(dt, "test_updateAlarm_DifferentType");
2124
2125 alarm.save();
2126- waitForRequest(&alarm);
2127+ waitAndFetch(&alarm);
2128 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2129 QVERIFY(containsAlarm(&alarm));
2130
2131 alarm.setType(UCAlarm::Repeating);
2132 QVERIFY(!compareAlarms(&alarm, &copy));
2133 alarm.save();
2134- waitForRequest(&alarm);
2135+ // do not fetch
2136+ waitForUpdate(&alarm);
2137 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2138 QVERIFY(containsAlarm(&alarm));
2139 QVERIFY(!containsAlarm(&copy));
2140@@ -375,20 +390,20 @@
2141 UCAlarm alarm(QDateTime::currentDateTime().addMSecs(5000), UCAlarm::AutoDetect, "test_updateAlarm_Repeating");
2142
2143 alarm.save();
2144- waitForRequest(&alarm);
2145+ waitAndFetch(&alarm);
2146 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2147 QSKIP("https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1322558");
2148 QVERIFY(containsAlarm(&alarm));
2149
2150 alarm.setDate(alarm.date().addDays(1));
2151 alarm.save();
2152- waitForRequest(&alarm);
2153+ waitForUpdate(&alarm);
2154 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2155 QVERIFY(containsAlarm(&alarm));
2156
2157 alarm.setDaysOfWeek(UCAlarm::Daily);
2158 alarm.save();
2159- waitForRequest(&alarm);
2160+ waitForUpdate(&alarm);
2161 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2162 QVERIFY(containsAlarm(&alarm));
2163 }
2164@@ -399,19 +414,19 @@
2165 UCAlarm alarm(dt, "test_fetchAlarmPlus7Days");
2166
2167 alarm.save();
2168- waitForRequest(&alarm);
2169+ waitAndFetch(&alarm);
2170 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2171 QVERIFY(containsAlarm(&alarm));
2172
2173 UCAlarm nextMonth(dt.addMonths(1), "test_fetchAlarmPlus1Month");
2174 nextMonth.save();
2175- waitForRequest(&nextMonth);
2176+ waitAndFetch(&nextMonth);
2177 QCOMPARE(nextMonth.error(), (int)UCAlarm::NoError);
2178 QVERIFY(containsAlarm(&nextMonth));
2179
2180 UCAlarm nextYear(dt.addYears(1), "test_fetchAlarmPlus1Year");
2181 nextYear.save();
2182- waitForRequest(&nextYear);
2183+ waitAndFetch(&nextYear);
2184 QCOMPARE(nextYear.error(), (int)UCAlarm::NoError);
2185 QVERIFY(containsAlarm(&nextYear));
2186 }
2187@@ -426,7 +441,7 @@
2188 UCAlarm nextAlarm(nextDt, UCAlarm::Daily, "test_correctAlarmOrderDaily");
2189
2190 alarm.save();
2191- waitForRequest(&alarm);
2192+ waitAndFetch(&alarm);
2193 QTest::qWait(2000);
2194 syncFetch();
2195 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2196@@ -443,7 +458,7 @@
2197 UCAlarm nextAlarm(nextDt, UCAlarm::AutoDetect, "test_correctAlarmOrderWeekly");
2198
2199 alarm.save();
2200- waitForRequest(&alarm);
2201+ waitAndFetch(&alarm);
2202 QTest::qWait(2000);
2203 syncFetch();
2204 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2205@@ -500,7 +515,7 @@
2206 UCAlarm alarm(QDateTime::currentDateTime().addSecs(3600), "test_oneTime_dow_" + message);
2207 alarm.setDaysOfWeek((UCAlarm::DaysOfWeek)dow);
2208 alarm.save();
2209- waitForRequest(&alarm);
2210+ waitAndFetch(&alarm);
2211 QCOMPARE(alarm.error(), (int)UCAlarm::NoError);
2212 QVERIFY(containsAlarm(&alarm));
2213 }
2214@@ -531,7 +546,7 @@
2215 UCAlarm alarm(QDateTime::currentDateTime().addSecs(60), "test_onetime_sound");
2216 alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg"));
2217 alarm.save();
2218- waitForRequest(&alarm);
2219+ waitAndFetch(&alarm);
2220
2221 UCAlarm saved;
2222 QVERIFY(findAlarm("test_onetime_sound", saved));
2223@@ -544,20 +559,20 @@
2224 UCAlarm alarm(QDateTime::currentDateTime(), UCAlarm::AutoDetect, "test_create_update_and_disable_alarm");
2225 alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg"));
2226 alarm.save();
2227- waitForRequest(&alarm);
2228+ waitAndFetch(&alarm);
2229 QVERIFY(containsAlarm(&alarm));
2230
2231 // update alarm to occur 1h earlier
2232 QDateTime date = alarm.date();
2233 date.addSecs(-60);
2234 alarm.save();
2235- waitForRequest(&alarm);
2236+ waitForUpdate(&alarm);
2237 QVERIFY(containsAlarm(&alarm));
2238
2239 // disable alarm
2240 alarm.setEnabled(false);
2241 alarm.save();
2242- waitForRequest(&alarm);
2243+ waitForUpdate(&alarm);
2244 QVERIFY(containsAlarm(&alarm));
2245 AlarmData data = getAlarmDataFromAlarmCookie(&alarm);
2246 QVERIFY(data.cookie.isValid());
2247@@ -567,14 +582,15 @@
2248 void test_change_alarm_sound()
2249 {
2250 UCAlarm alarm(QDateTime::currentDateTime(), UCAlarm::AutoDetect, "test_change_alarm_fields_sound");
2251+ alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Bliss.ogg"));
2252 alarm.save();
2253- waitForRequest(&alarm);
2254+ waitAndFetch(&alarm);
2255 QVERIFY(containsAlarm(&alarm));
2256
2257 // do the change
2258- alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg"));
2259+ alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Sparkle.ogg"));
2260 alarm.save();
2261- waitForRequest(&alarm);
2262+ waitForUpdate(&alarm);
2263 QVERIFY(containsAlarm(&alarm));
2264
2265 //verify whether we have the desired change
2266@@ -595,9 +611,10 @@
2267 QFETCH(bool, enabled);
2268
2269 UCAlarm alarm(QDateTime::currentDateTime().addDays(1), "test_check_alarm_tags_" + message);
2270+ alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Marimbach.ogg"));
2271 alarm.setEnabled(enabled);
2272 alarm.save();
2273- waitForRequest(&alarm);
2274+ waitAndFetch(&alarm);
2275 QVERIFY(containsAlarm(&alarm));
2276
2277 // check the tags
2278
2279=== modified file 'tests/unit/tst_i18n/src/LocalizedApp.qml'
2280--- tests/unit/tst_i18n/src/LocalizedApp.qml 2014-04-23 08:50:20 +0000
2281+++ tests/unit/tst_i18n/src/LocalizedApp.qml 2014-10-16 12:58:00 +0000
2282@@ -24,7 +24,7 @@
2283
2284 Page {
2285 objectName: 'page'
2286- title: i18n.dtr('localizedApp', 'Welcome')
2287+ title: i18n.dtr('localizedApp', "Welcome")
2288 Button {
2289 objectName: 'button'
2290 anchors.centerIn: parent
2291
2292=== modified file 'tests/unit_x11/tst_components/tst_textarea.qml'
2293--- tests/unit_x11/tst_components/tst_textarea.qml 2014-06-24 14:03:44 +0000
2294+++ tests/unit_x11/tst_components/tst_textarea.qml 2014-10-16 12:58:00 +0000
2295@@ -191,6 +191,16 @@
2296
2297 function test_0_readOnly() {
2298 compare(textArea.readOnly,textEdit.readOnly,"TextArea.readOnly is same as TextEdit.readOnly")
2299+
2300+ textArea.text = "ab";
2301+ textArea.cursorPosition = 1;
2302+ textArea.textFormat = TextEdit.PlainText;
2303+ keyClick(Qt.Key_Return);
2304+ compare("ab", textArea.text, "No split occurred in plain area");
2305+
2306+ textArea.textFormat = TextEdit.RichText;
2307+ keyClick(Qt.Key_Return);
2308+ compare(textArea.text.indexOf("<br />"), -1, "No split occurred in rich area");
2309 }
2310
2311 function test_0_renderType() {

Subscribers

People subscribed via source and target branches

to status/vote changes: