Merge lp:~marcinello/ubuntu-calendar-app/fix-1280612 into lp:ubuntu-calendar-app

Proposed by Marcin
Status: Merged
Approved by: Kunal Parmar
Approved revision: 225
Merged at revision: 224
Proposed branch: lp:~marcinello/ubuntu-calendar-app/fix-1280612
Merge into: lp:ubuntu-calendar-app
Diff against target: 49 lines (+14/-10)
1 file modified
EventDetails.qml (+14/-10)
To merge this branch: bzr merge lp:~marcinello/ubuntu-calendar-app/fix-1280612
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Kunal Parmar Approve
Review via email: mp+213064@code.launchpad.net

Commit message

fix for Bug #1280612 do not display map when no location: https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1280612

Now we not only hide the map, but also show "Not specified" under location label.

Description of the change

fix for Bug #1280612 do not display map when no location: https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1280612

Now we not only hide the map, but also show "Not specified" under location label.

To post a comment you must log in.
224. By Marcin

fix #1280612, handle image load error

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

49 + visible: false

what if we use following code instead ?

49 + visible: mapImage.status == Image.Ready

225. By Marcin

fix #1280612, improved implementation, save fix

Revision history for this message
Marcin (marcinello) wrote :

@Kunal thanks, it looks better this way. I fixed the code.

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

works great, thanks

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventDetails.qml'
2--- EventDetails.qml 2014-02-19 11:39:13 +0000
3+++ EventDetails.qml 2014-03-28 17:50:07 +0000
4@@ -51,11 +51,6 @@
5 titleLabel.text = e.displayLabel;
6 }
7
8- var location = "";
9- if( e.location ) {
10- locationLabel.text = e.location;
11- location = e.location;
12- }
13 if( e.description ) {
14 descLabel.text = e.description;
15 }
16@@ -83,12 +78,20 @@
17 }
18 reminderHeader.value = Defines.reminderLabel[index];
19
20+ if( e.location ) {
21+ locationLabel.text = e.location;
22
23- // FIXME: need to cache map image to avoid duplicate download every time
24- var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+location+
25- "&markers=color:red|"+location+"&zoom=15&size="+mapContainer.width+
26- "x"+mapContainer.height+"&sensor=false";
27- mapImage.source=imageSrc;
28+ // FIXME: need to cache map image to avoid duplicate download every time
29+ var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+e.location+
30+ "&markers=color:red|"+e.location+"&zoom=15&size="+mapContainer.width+
31+ "x"+mapContainer.height+"&sensor=false";
32+ mapImage.source = imageSrc;
33+ }
34+ else {
35+ // TODO: use different color for empty text
36+ locationLabel.text = i18n.tr("Not specified")
37+ mapImage.source = "";
38+ }
39 }
40
41 tools: ToolbarItems {
42@@ -195,6 +198,7 @@
43 id: mapContainer
44 width:parent.width
45 height: units.gu(10)
46+ visible: mapImage.status == Image.Ready
47
48 Image {
49 id: mapImage

Subscribers

People subscribed via source and target branches

to status/vote changes: