Merge lp:~renatofilho/ubuntu-calendar-app/fix-1438910 into lp:ubuntu-calendar-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Arthur Mello
Approved revision: 811
Merged at revision: 812
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/fix-1438910
Merge into: lp:ubuntu-calendar-app
Diff against target: 63 lines (+8/-5)
2 files modified
EventRepetition.qml (+1/-2)
NewEvent.qml (+7/-3)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/fix-1438910
Reviewer Review Type Date Requested Status
Arthur Mello (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+290655@code.launchpad.net

Commit message

Set event as parent for RecurrenceRule to avoid it to be destroyed before the event.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventRepetition.qml'
2--- EventRepetition.qml 2016-03-22 20:09:08 +0000
3+++ EventRepetition.qml 2016-03-31 20:55:39 +0000
4@@ -100,7 +100,7 @@
5
6 if (recurrenceRule !== RecurrenceRule.Invalid) {
7 if (eventRoot.rule === null || eventRoot.rule === undefined ){
8- eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event.recurrence,"EventRepetition.qml");
9+ eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event,"EventRepetition.qml");
10 }
11
12 var rule = eventRoot.rule;
13@@ -114,7 +114,6 @@
14 rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays );
15 break;
16 case 6: //monthly
17- rule.daysOfMonth = [eventRoot.startDate.getDate()];
18 break;
19 case 7: //yearly
20 break;
21
22=== modified file 'NewEvent.qml'
23--- NewEvent.qml 2016-03-28 20:56:13 +0000
24+++ NewEvent.qml 2016-03-31 20:55:39 +0000
25@@ -219,6 +219,11 @@
26 var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
27 if (!isOcurrence) {
28 if(rule !== null && rule !== undefined) {
29+ // update monthly rule with final event day
30+ // we need to do it here to make sure that the day is the same day as the event startDate
31+ if (rule.frequency === RecurrenceRule.Monthly) {
32+ rule.daysOfMonth = [event.startDateTime.getDate()]
33+ }
34 event.recurrence.recurrenceRules = [rule]
35 } else {
36 event.recurrence.recurrenceRules = [];
37@@ -230,7 +235,7 @@
38 var reminder = event.detail(Detail.AudibleReminder);
39 if (root.reminderValue >= 0) {
40 if (!reminder) {
41- reminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder {}", root, "")
42+ reminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder {}", event, "")
43 reminder.repetitionCount = 0
44 reminder.repetitionDelay = 0
45 }
46@@ -241,7 +246,6 @@
47 }
48
49 event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
50- model.setDefaultCollection(event.collectionId);
51
52 var comment = event.detail(Detail.Comment);
53 if(comment && comment.comment === "X-CAL-DEFAULT-EVENT") {
54@@ -249,9 +253,9 @@
55 }
56
57 model.saveItem(event)
58+ root.eventAdded(event);
59 if (pageStack)
60 pageStack.pop();
61- root.eventAdded(event);
62 }
63 }
64

Subscribers

People subscribed via source and target branches

to status/vote changes: