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

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 332
Merged at revision: 331
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble_Cache
Merge into: lp:ubuntu-calendar-app
Diff against target: 122 lines (+24/-18)
4 files modified
EventBubble.qml (+1/-3)
TimeLineBase.qml (+11/-4)
TimeLineBaseComponent.qml (+7/-0)
TimeLineHeader.qml (+5/-11)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble_Cache
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+224012@code.launchpad.net

Commit message

Resolved, Bug #1329320
-> Now hiding event bubbles on day change and showing those when model is loaded
-> instead of creating and destroying events bubbles on every date change, reusing event bubbles

Description of the change

Resolved, Bug #1329320
-> Now hiding event bubbles on day change and showing those when model is loaded
-> instead of creating and destroying events bubbles on every date change, reusing event bubbles

To post a comment you must log in.
332. By Kunal Parmar

commented out code removed

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tested on desktop and nexus 4, works really nice, thanks Kunal!

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

Looks good to me kunal !

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventBubble.qml'
2--- EventBubble.qml 2014-06-10 12:28:31 +0000
3+++ EventBubble.qml 2014-06-21 03:46:37 +0000
4@@ -95,7 +95,7 @@
5 }
6
7 function layoutBubbleDetails() {
8- if(!flickable || flickable === undefined ) {
9+ if( !flickable || flickable === undefined ) {
10 return;
11 }
12
13@@ -118,8 +118,6 @@
14 Item {
15 id: detailsItems
16
17- visible: flickable
18-
19 width: parent.width
20 height: detailsColumn.height
21
22
23=== modified file 'TimeLineBase.qml'
24--- TimeLineBase.qml 2014-06-07 04:13:31 +0000
25+++ TimeLineBase.qml 2014-06-21 03:46:37 +0000
26@@ -34,6 +34,7 @@
27 id: intern
28 property var now : new Date();
29 property var eventMap;
30+ property var unUsedEvents: new Array;
31 }
32
33 function showEventDetails(event) {
34@@ -65,7 +66,6 @@
35 if(!bubbleOverLay || bubbleOverLay == undefined) {
36 return;
37 }
38- destroyAllChildren();
39
40 var eventMap = {};
41 var allSchs = [];
42@@ -100,15 +100,21 @@
43 }
44 children[i].visible = false;
45 if( children[i].objectName !== "separator") {
46- children[i].destroy();
47+ intern.unUsedEvents.push(children[i])
48 }
49 }
50 }
51
52 function createEvent( event, x, width ) {
53+
54+ var eventBubble;
55+ if( intern.unUsedEvents.length == 0) {
56+ eventBubble = delegate.createObject(bubbleOverLay);
57+ } else {
58+ eventBubble = intern.unUsedEvents.pop();
59+ }
60+
61 var hour = event.startDateTime.getHours();
62- var eventBubble = delegate.createObject(bubbleOverLay);
63-
64 var yPos = (( event.startDateTime.getMinutes() * hourHeight) / 60) + hour * hourHeight
65 eventBubble.y = yPos;
66
67@@ -120,6 +126,7 @@
68 eventBubble.x = x;
69 eventBubble.width = width;
70 eventBubble.event = event
71+ eventBubble.visible = true;
72 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );
73 }
74
75
76=== modified file 'TimeLineBaseComponent.qml'
77--- TimeLineBaseComponent.qml 2014-06-13 13:55:33 +0000
78+++ TimeLineBaseComponent.qml 2014-06-21 03:46:37 +0000
79@@ -126,6 +126,13 @@
80 delegate: comp
81 day: startDay.addDays(index)
82
83+ Connections{
84+ target: mainModel
85+ onStartPeriodChanged:{
86+ destroyAllChildren();
87+ }
88+ }
89+
90 model: mainModel
91 Component.onCompleted: {
92 model.addModelChangeListener(createEvents);
93
94=== modified file 'TimeLineHeader.qml'
95--- TimeLineHeader.qml 2014-04-12 04:02:41 +0000
96+++ TimeLineHeader.qml 2014-06-21 03:46:37 +0000
97@@ -38,21 +38,15 @@
98 }
99 }
100
101- startDay: getStartDate();
102+ startDay: {
103+ (type == ViewType.ViewTypeWeek) ?
104+ date.addDays(7*header.indexType(index)) :
105+ date.addDays(1*header.indexType(index));
106+ }
107
108 onDateSelected: {
109 header.dateSelected(date);
110 }
111-
112- function getStartDate() {
113- var indexType = header.indexType(index);
114- switch(type) {
115- case ViewType.ViewTypeWeek:
116- return date.addDays(7*indexType);
117- case ViewType.ViewTypeDay:
118- return date.addDays(1*indexType);
119- }
120- }
121 }
122 }
123

Subscribers

People subscribed via source and target branches

to status/vote changes: