ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #08750
[Merge] lp:~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence into lp:ubuntu-calendar-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence into lp:ubuntu-calendar-app.
Commit message:
Fix edit occurrence.
Block to change recurrence field of occurrence events.
Requested reviews:
Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
Bug #1447930 in Ubuntu Calendar App: "yearly appointments repetition incorrect"
https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1447930
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence/+merge/288638
--
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-calendar-app/fix-edit-ocurrence into lp:ubuntu-calendar-app.
=== modified file 'EventDetails.qml'
--- EventDetails.qml 2016-03-02 19:55:52 +0000
+++ EventDetails.qml 2016-03-10 13:38:18 +0000
@@ -56,6 +56,23 @@
}
}
+ Connections{
+ target: model
+ onItemsFetched: {
+ if (internal.fetchParentRequestId === requestId) {
+ if (fetchedItems.length > 0) {
+ internal.parentEvent = fetchedItems[0];
+ updateRecurrence(internal.parentEvent);
+ updateContacts(internal.parentEvent);
+ } else {
+ console.warn("Fail to fetch pareten event")
+ }
+ internal.fetchParentRequestId = -1
+ }
+
+ }
+ }
+
RemindersModel {
id: reminderModel
}
@@ -176,17 +193,11 @@
}
}
- if( e.itemType === Type.EventOccurrence ){
- var requestId = -1;
- model.onItemsFetched.connect( function(id,fetchedItems){
- if(requestId === id && fetchedItems.length > 0) {
- internal.parentEvent = fetchedItems[0];
- updateRecurrence(internal.parentEvent);
- updateContacts(internal.parentEvent);
- }
- });
- requestId = model.fetchItems([e.parentId]);
+ var isOcurrence = (e.itemType === Type.EventOccurrence) || (e.itemType === Type.TodoOccurrence)
+ if (isOcurrence) {
+ internal.fetchParentRequestId = model.fetchItems([e.parentId]);
}
+
// This is the event title
if( e.displayLabel) {
titleLabel.text = e.displayLabel;
@@ -261,6 +272,7 @@
QtObject{
id: internal
+ property int fetchParentRequestId: -1;
property var parentEvent;
}
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-03-07 17:57:04 +0000
+++ NewEvent.qml 2016-03-10 13:38:18 +0000
@@ -123,7 +123,8 @@
//Editing Event
function editEvent(e) {
//If there is a ReccruenceRule use that , else create fresh Recurrence Object.
- if(e.itemType === Type.Event && e.recurrence.recurrenceRules[0] !== undefined
+ var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
+ if(!isOcurrence && e.recurrence.recurrenceRules[0] !== undefined
&& e.recurrence.recurrenceRules[0] !== null){
rule = e.recurrence.recurrenceRules[0];
}
@@ -208,10 +209,13 @@
}
//Set the Rule object to an event
- if(rule !== null && rule !== undefined) {
- event.recurrence.recurrenceRules = [rule]
- } else {
- event.recurrence.recurrenceRules = [];
+ var isOcurrence = ((event.itemType === Type.EventOccurrence) || (event.itemType === Type.TodoOccurrence))
+ if (!isOcurrence) {
+ if(rule !== null && rule !== undefined) {
+ event.recurrence.recurrenceRules = [rule]
+ } else {
+ event.recurrence.recurrenceRules = [];
+ }
}
//remove old reminder value
@@ -684,9 +688,9 @@
showDivider: false
progression: true
- visible: (event != undefined) && (event.itemType === Type.Event)
+ visible: (event != undefined) && ((event.itemType === Type.Event) || (event.itemType === Type.Todo))
text: i18n.tr("Repeats")
- subText: (event != undefined) && (event.itemType === Type.Event) ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
+ subText: visible ? rule === null ? Defines.recurrenceLabel[0] : eventUtils.getRecurrenceString(rule) : ""
onClicked: {
var stack = pageStack
if (!stack)
References