Merge lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri on 2014-08-06
Status: Merged
Approved by: Zoltan Balogh on 2014-08-12
Approved revision: 1182
Merged at revision: 1185
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 116 lines (+38/-4)
5 files modified
modules/Ubuntu/Components/plugin/alarmmanager_p.h (+3/-2)
modules/Ubuntu/Components/plugin/ucalarm.cpp (+7/-0)
modules/Ubuntu/Components/plugin/ucalarm.h (+2/-0)
modules/Ubuntu/Components/plugin/ucalarm_p.h (+2/-2)
tests/unit/tst_alarms/tst_alarms.cpp (+24/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2014-08-12
Christian Dywan (community) 2014-08-06 Approve on 2014-08-06
Nekhelesh Ramananthan (community) testing Approve on 2014-08-06
Review via email: mp+229800@code.launchpad.net

Commit message

Alarm sounds lost during fetch fix.

To post a comment you must log in.
Nekhelesh Ramananthan (nik90) wrote :

On testing this MP against https://bugs.launchpad.net/+branch/~nik90/ubuntu-clock-app/alarmtest, it works as expected. The alarm sound url is now properly retrieved while editing an alarm.

SideNote: I can now make install this MP on my utopic VM which has EDS as the alarm backend. No more it getting stuck during the make install process :D

review: Approve (testing)
Christian Dywan (kalikiana) wrote :

Looks sensible.

review: Approve
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1182
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/736/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3117
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2446
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/568
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/568
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/568/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/568
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4361
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4361/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11103
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2028
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2716
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2716/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/736/rebuild

review: Approve (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/324/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3147
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2475
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/268
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/268
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/268/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/268
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4392
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4392/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11131
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2048
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2746
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2746/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/327/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3152
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2480
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/271
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/271
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/271/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/271
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3182
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4397
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4397/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11137
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2053
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2751
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2751/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Christian Dywan (kalikiana) wrote :

  File "/usr/lib/python3/dist-packages/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py", line 218, in test_pick_time
    self.time_picker.pick_time(self.time_to_pick)
  File "/usr/lib/python3/dist-packages/ubuntuuitoolkit/_custom_proxy_objects/pickers.py", line 141, in pick_time
    self.hours.wait_for(time.hour)
AssertionError: After 10.0 seconds test on DatePicker.hours failed: 12 != dbus.Int32(13, variant_level=1)

Zsombor Egri (zsombi) wrote :

> File "/usr/lib/python3/dist-
> packages/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py", line
> 218, in test_pick_time
> self.time_picker.pick_time(self.time_to_pick)
> File "/usr/lib/python3/dist-
> packages/ubuntuuitoolkit/_custom_proxy_objects/pickers.py", line 141, in
> pick_time
> self.hours.wait_for(time.hour)
> AssertionError: After 10.0 seconds test on DatePicker.hours failed: 12 !=
> dbus.Int32(13, variant_level=1)

Looks like the AP tests we have for the DatePicker are not the most stable ones :/

PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1182
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/785/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3380
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2651/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/617
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/617
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/617/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/617
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3307
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4627
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4627/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11307
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2142/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2928
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2928/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/785/rebuild

review: Needs Fixing (continuous-integration)
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/alarmmanager_p.h'
2--- modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-03-11 06:32:29 +0000
3+++ modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-08-06 14:24:24 +0000
4@@ -51,13 +51,14 @@
5 , originalDate(other.originalDate)
6 , date(other.date)
7 , message(other.message)
8+ , sound(other.sound)
9 , type(other.type)
10 , days(other.days)
11 , enabled(other.enabled)
12 {
13 }
14
15- bool compare(const AlarmData &other)
16+ bool compare(const AlarmData &other) const
17 {
18 // cookie, sound, and enabled do not count on alarm equality
19 return date == other.date
20@@ -66,7 +67,7 @@
21 && days == other.days;
22 }
23
24- bool operator==(const AlarmData &other)
25+ bool operator==(const AlarmData &other) const
26 {
27 return compare(other);
28 }
29
30=== modified file 'modules/Ubuntu/Components/plugin/ucalarm.cpp'
31--- modules/Ubuntu/Components/plugin/ucalarm.cpp 2014-05-15 09:49:25 +0000
32+++ modules/Ubuntu/Components/plugin/ucalarm.cpp 2014-08-06 14:24:24 +0000
33@@ -343,6 +343,13 @@
34 {
35 }
36
37+bool UCAlarm::operator==(const UCAlarm &that) const
38+{
39+ Q_D(const UCAlarm);
40+ AlarmData const dataThat = UCAlarmPrivate::get(&that)->rawData;
41+ return d->rawData == dataThat;
42+}
43+
44 /*!
45 * \qmlproperty bool Alarm::enabled
46 * The property specifies whether the alarm is enabled or not. Disable dalarms
47
48=== modified file 'modules/Ubuntu/Components/plugin/ucalarm.h'
49--- modules/Ubuntu/Components/plugin/ucalarm.h 2013-09-18 10:13:04 +0000
50+++ modules/Ubuntu/Components/plugin/ucalarm.h 2014-08-06 14:24:24 +0000
51@@ -89,6 +89,8 @@
52 UCAlarm(const QDateTime &dt, DaysOfWeek days = AutoDetect, const QString &message = QString(), QObject *parent = 0);
53 ~UCAlarm();
54
55+ bool operator==(const UCAlarm &that) const;
56+
57 public: // getter/setter
58 bool enabled() const;
59 void setEnabled(bool enabled);
60
61=== modified file 'modules/Ubuntu/Components/plugin/ucalarm_p.h'
62--- modules/Ubuntu/Components/plugin/ucalarm_p.h 2014-04-10 09:48:30 +0000
63+++ modules/Ubuntu/Components/plugin/ucalarm_p.h 2014-08-06 14:24:24 +0000
64@@ -31,8 +31,8 @@
65 UCAlarmPrivate(UCAlarm *qq);
66 ~UCAlarmPrivate();
67
68- static UCAlarmPrivate *get(UCAlarm *alarm) {
69- return alarm->d_func();
70+ static UCAlarmPrivate *get(const UCAlarm *alarm) {
71+ return const_cast<UCAlarm*>(alarm)->d_func();
72 }
73
74 void setDefaults();
75
76=== modified file 'tests/unit/tst_alarms/tst_alarms.cpp'
77--- tests/unit/tst_alarms/tst_alarms.cpp 2014-07-28 16:47:50 +0000
78+++ tests/unit/tst_alarms/tst_alarms.cpp 2014-08-06 14:24:24 +0000
79@@ -92,6 +92,18 @@
80 return pAlarm1->rawData.compare(pAlarm2->rawData);
81 }
82
83+ bool findAlarm(const QString &message, UCAlarm &result)
84+ {
85+ QList<AlarmData> alarms = AlarmManager::instance().alarms();
86+ Q_FOREACH(AlarmData i, alarms) {
87+ if (i.message == message) {
88+ UCAlarmPrivate::get(&result)->rawData = i;
89+ return true;
90+ }
91+ }
92+ return false;
93+ }
94+
95 private Q_SLOTS:
96
97 void initTestCase()
98@@ -502,6 +514,18 @@
99 alarm.setDate(QDateTime::currentDateTime().addSecs(3600));
100 QCOMPARE((int)alarm.daysOfWeek(), dow);
101 }
102+
103+ void test_sound_saving() {
104+ UCAlarm alarm(QDateTime::currentDateTime().addSecs(60), "test_onetime_sound");
105+ alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg"));
106+ alarm.save();
107+ waitForRequest(&alarm);
108+
109+ UCAlarm saved;
110+ QVERIFY(findAlarm("test_onetime_sound", saved));
111+ QCOMPARE(alarm, saved);
112+ QCOMPARE(alarm.sound().toString(), saved.sound().toString());
113+ }
114 };
115
116 QTEST_MAIN(tst_UCAlarms)

Subscribers

People subscribed via source and target branches