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
=== modified file 'EventRepetition.qml'
--- EventRepetition.qml 2016-03-22 20:09:08 +0000
+++ EventRepetition.qml 2016-03-31 20:55:39 +0000
@@ -100,7 +100,7 @@
100100
101 if (recurrenceRule !== RecurrenceRule.Invalid) {101 if (recurrenceRule !== RecurrenceRule.Invalid) {
102 if (eventRoot.rule === null || eventRoot.rule === undefined ){102 if (eventRoot.rule === null || eventRoot.rule === undefined ){
103 eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event.recurrence,"EventRepetition.qml");103 eventRoot.rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", eventRoot.event,"EventRepetition.qml");
104 }104 }
105105
106 var rule = eventRoot.rule;106 var rule = eventRoot.rule;
@@ -114,7 +114,6 @@
114 rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays );114 rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays );
115 break;115 break;
116 case 6: //monthly116 case 6: //monthly
117 rule.daysOfMonth = [eventRoot.startDate.getDate()];
118 break;117 break;
119 case 7: //yearly118 case 7: //yearly
120 break;119 break;
121120
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-03-28 20:56:13 +0000
+++ NewEvent.qml 2016-03-31 20:55:39 +0000
@@ -219,6 +219,11 @@
219 var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))219 var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
220 if (!isOcurrence) {220 if (!isOcurrence) {
221 if(rule !== null && rule !== undefined) {221 if(rule !== null && rule !== undefined) {
222 // update monthly rule with final event day
223 // we need to do it here to make sure that the day is the same day as the event startDate
224 if (rule.frequency === RecurrenceRule.Monthly) {
225 rule.daysOfMonth = [event.startDateTime.getDate()]
226 }
222 event.recurrence.recurrenceRules = [rule]227 event.recurrence.recurrenceRules = [rule]
223 } else {228 } else {
224 event.recurrence.recurrenceRules = [];229 event.recurrence.recurrenceRules = [];
@@ -230,7 +235,7 @@
230 var reminder = event.detail(Detail.AudibleReminder);235 var reminder = event.detail(Detail.AudibleReminder);
231 if (root.reminderValue >= 0) {236 if (root.reminderValue >= 0) {
232 if (!reminder) {237 if (!reminder) {
233 reminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder {}", root, "")238 reminder = Qt.createQmlObject("import QtOrganizer 5.0; AudibleReminder {}", event, "")
234 reminder.repetitionCount = 0239 reminder.repetitionCount = 0
235 reminder.repetitionDelay = 0240 reminder.repetitionDelay = 0
236 }241 }
@@ -241,7 +246,6 @@
241 }246 }
242247
243 event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;248 event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
244 model.setDefaultCollection(event.collectionId);
245249
246 var comment = event.detail(Detail.Comment);250 var comment = event.detail(Detail.Comment);
247 if(comment && comment.comment === "X-CAL-DEFAULT-EVENT") {251 if(comment && comment.comment === "X-CAL-DEFAULT-EVENT") {
@@ -249,9 +253,9 @@
249 }253 }
250254
251 model.saveItem(event)255 model.saveItem(event)
256 root.eventAdded(event);
252 if (pageStack)257 if (pageStack)
253 pageStack.pop();258 pageStack.pop();
254 root.eventAdded(event);
255 }259 }
256 }260 }
257261

Subscribers

People subscribed via source and target branches

to status/vote changes: