Merge lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix into lp:ubuntu-ui-toolkit/staging
- alarm-sound-fix
- Merge into staging
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Zoltan Balogh | ||||
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Nekhelesh Ramananthan (community) | testing | Approve | |
Review via email: mp+229800@code.launchpad.net |
Commit message
Alarm sounds lost during fetch fix.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1182
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Cris Dywan (kalikiana) wrote : | # |
File "/usr/lib/
self.
File "/usr/lib/
self.
AssertionError: After 10.0 seconds test on DatePicker.hours failed: 12 != dbus.Int32(13, variant_level=1)
Zsombor Egri (zsombi) wrote : | # |
> File "/usr/lib/
> packages/
> 218, in test_pick_time
> self.time_
> File "/usr/lib/
> packages/
> pick_time
> self.hours.
> 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: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1182
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
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 | 51 | , originalDate(other.originalDate) | 51 | , originalDate(other.originalDate) |
6 | 52 | , date(other.date) | 52 | , date(other.date) |
7 | 53 | , message(other.message) | 53 | , message(other.message) |
8 | 54 | , sound(other.sound) | ||
9 | 54 | , type(other.type) | 55 | , type(other.type) |
10 | 55 | , days(other.days) | 56 | , days(other.days) |
11 | 56 | , enabled(other.enabled) | 57 | , enabled(other.enabled) |
12 | 57 | { | 58 | { |
13 | 58 | } | 59 | } |
14 | 59 | 60 | ||
16 | 60 | bool compare(const AlarmData &other) | 61 | bool compare(const AlarmData &other) const |
17 | 61 | { | 62 | { |
18 | 62 | // cookie, sound, and enabled do not count on alarm equality | 63 | // cookie, sound, and enabled do not count on alarm equality |
19 | 63 | return date == other.date | 64 | return date == other.date |
20 | @@ -66,7 +67,7 @@ | |||
21 | 66 | && days == other.days; | 67 | && days == other.days; |
22 | 67 | } | 68 | } |
23 | 68 | 69 | ||
25 | 69 | bool operator==(const AlarmData &other) | 70 | bool operator==(const AlarmData &other) const |
26 | 70 | { | 71 | { |
27 | 71 | return compare(other); | 72 | return compare(other); |
28 | 72 | } | 73 | } |
29 | 73 | 74 | ||
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 | 343 | { | 343 | { |
35 | 344 | } | 344 | } |
36 | 345 | 345 | ||
37 | 346 | bool UCAlarm::operator==(const UCAlarm &that) const | ||
38 | 347 | { | ||
39 | 348 | Q_D(const UCAlarm); | ||
40 | 349 | AlarmData const dataThat = UCAlarmPrivate::get(&that)->rawData; | ||
41 | 350 | return d->rawData == dataThat; | ||
42 | 351 | } | ||
43 | 352 | |||
44 | 346 | /*! | 353 | /*! |
45 | 347 | * \qmlproperty bool Alarm::enabled | 354 | * \qmlproperty bool Alarm::enabled |
46 | 348 | * The property specifies whether the alarm is enabled or not. Disable dalarms | 355 | * The property specifies whether the alarm is enabled or not. Disable dalarms |
47 | 349 | 356 | ||
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 | 89 | UCAlarm(const QDateTime &dt, DaysOfWeek days = AutoDetect, const QString &message = QString(), QObject *parent = 0); | 89 | UCAlarm(const QDateTime &dt, DaysOfWeek days = AutoDetect, const QString &message = QString(), QObject *parent = 0); |
53 | 90 | ~UCAlarm(); | 90 | ~UCAlarm(); |
54 | 91 | 91 | ||
55 | 92 | bool operator==(const UCAlarm &that) const; | ||
56 | 93 | |||
57 | 92 | public: // getter/setter | 94 | public: // getter/setter |
58 | 93 | bool enabled() const; | 95 | bool enabled() const; |
59 | 94 | void setEnabled(bool enabled); | 96 | void setEnabled(bool enabled); |
60 | 95 | 97 | ||
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 | 31 | UCAlarmPrivate(UCAlarm *qq); | 31 | UCAlarmPrivate(UCAlarm *qq); |
66 | 32 | ~UCAlarmPrivate(); | 32 | ~UCAlarmPrivate(); |
67 | 33 | 33 | ||
70 | 34 | static UCAlarmPrivate *get(UCAlarm *alarm) { | 34 | static UCAlarmPrivate *get(const UCAlarm *alarm) { |
71 | 35 | return alarm->d_func(); | 35 | return const_cast<UCAlarm*>(alarm)->d_func(); |
72 | 36 | } | 36 | } |
73 | 37 | 37 | ||
74 | 38 | void setDefaults(); | 38 | void setDefaults(); |
75 | 39 | 39 | ||
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 | 92 | return pAlarm1->rawData.compare(pAlarm2->rawData); | 92 | return pAlarm1->rawData.compare(pAlarm2->rawData); |
81 | 93 | } | 93 | } |
82 | 94 | 94 | ||
83 | 95 | bool findAlarm(const QString &message, UCAlarm &result) | ||
84 | 96 | { | ||
85 | 97 | QList<AlarmData> alarms = AlarmManager::instance().alarms(); | ||
86 | 98 | Q_FOREACH(AlarmData i, alarms) { | ||
87 | 99 | if (i.message == message) { | ||
88 | 100 | UCAlarmPrivate::get(&result)->rawData = i; | ||
89 | 101 | return true; | ||
90 | 102 | } | ||
91 | 103 | } | ||
92 | 104 | return false; | ||
93 | 105 | } | ||
94 | 106 | |||
95 | 95 | private Q_SLOTS: | 107 | private Q_SLOTS: |
96 | 96 | 108 | ||
97 | 97 | void initTestCase() | 109 | void initTestCase() |
98 | @@ -502,6 +514,18 @@ | |||
99 | 502 | alarm.setDate(QDateTime::currentDateTime().addSecs(3600)); | 514 | alarm.setDate(QDateTime::currentDateTime().addSecs(3600)); |
100 | 503 | QCOMPARE((int)alarm.daysOfWeek(), dow); | 515 | QCOMPARE((int)alarm.daysOfWeek(), dow); |
101 | 504 | } | 516 | } |
102 | 517 | |||
103 | 518 | void test_sound_saving() { | ||
104 | 519 | UCAlarm alarm(QDateTime::currentDateTime().addSecs(60), "test_onetime_sound"); | ||
105 | 520 | alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg")); | ||
106 | 521 | alarm.save(); | ||
107 | 522 | waitForRequest(&alarm); | ||
108 | 523 | |||
109 | 524 | UCAlarm saved; | ||
110 | 525 | QVERIFY(findAlarm("test_onetime_sound", saved)); | ||
111 | 526 | QCOMPARE(alarm, saved); | ||
112 | 527 | QCOMPARE(alarm.sound().toString(), saved.sound().toString()); | ||
113 | 528 | } | ||
114 | 505 | }; | 529 | }; |
115 | 506 | 530 | ||
116 | 507 | QTEST_MAIN(tst_UCAlarms) | 531 | QTEST_MAIN(tst_UCAlarms) |
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