Merge lp:~pkunal-parmar/ubuntu-calendar-app/DefCalendar into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 697
Merged at revision: 706
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/DefCalendar
Merge into: lp:ubuntu-calendar-app
Diff against target: 63 lines (+27/-1)
2 files modified
EventListModel.qml (+24/-0)
NewEvent.qml (+3/-1)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/DefCalendar
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+264990@code.launchpad.net

Commit message

resolves Bug #1369543

Description of the change

resolves Bug #1369543

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

it works fine , but there is a small change, it seems we are not using declared variable , we should remove that if we are not using it.

review: Needs Fixing
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Thanks, I updated the MR

696. By Kunal Parmar

review comment

697. By Kunal Parmar

merge from trunk

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me.
Thanks Kunal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventListModel.qml'
2--- EventListModel.qml 2015-07-30 19:18:55 +0000
3+++ EventListModel.qml 2015-08-02 03:59:36 +0000
4@@ -90,6 +90,30 @@
5 return cals;
6 }
7
8+ function getDefaultCollection() {
9+ var cals = getCollections();
10+ for(var i = 0 ; i < cals.length ; ++i) {
11+ var cal = cals[i]
12+ var val = cal.extendedMetaData("X-CAL-DEFAULT-CALENDAR")
13+ if( val ) {
14+ return cal;
15+ }
16+ }
17+
18+ return defaultCollection();
19+ }
20+
21+ function setDefaultCollection( collectionId ) {
22+ var cals = getCollections();
23+ for(var i = 0 ; i < cals.length ; ++i) {
24+ var cal = cals[i]
25+ cal.setExtendedMetaData("X-CAL-DEFAULT-CALENDAR", false);
26+ if( cal.collectionId === collectionId) {
27+ cal.setExtendedMetaData("X-CAL-DEFAULT-CALENDAR", true);
28+ }
29+ }
30+ }
31+
32 onStartPeriodChanged: {
33 isLoading = true
34 }
35
36=== modified file 'NewEvent.qml'
37--- NewEvent.qml 2015-07-30 19:33:41 +0000
38+++ NewEvent.qml 2015-08-02 03:59:36 +0000
39@@ -136,7 +136,7 @@
40 event = Qt.createQmlObject("import QtOrganizer 5.0; Event { }", Qt.application,"NewEvent.qml");
41 //Create fresh Recurrence Object.
42 rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence,"EventRepetition.qml");
43- selectCalendar(model.defaultCollection().collectionId);
44+ selectCalendar(model.getDefaultCollection().collectionId);
45 }
46
47 //Editing Event
48@@ -186,6 +186,7 @@
49
50 selectCalendar(e.collectionId);
51 }
52+
53 //Save the new or Existing event
54 function saveToQtPim() {
55 internal.clearFocus()
56@@ -245,6 +246,7 @@
57 event.setDetail(audibleReminder);
58 }
59 event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
60+ model.setDefaultCollection(event.collectionId);
61
62 var comment = event.detail(Detail.Comment);
63 if(comment && comment.comment === "X-CAL-DEFAULT-EVENT") {

Subscribers

People subscribed via source and target branches

to status/vote changes: