diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2013-09-22 10:20:50 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2013-09-22 10:20:50 +0200 |
commit | 00436c5812fb9eec1a699740829830cbb65c9a6e (patch) | |
tree | dd3d1cdf69be903389a0413051ea700459030c77 /cgeo-calendar | |
parent | fe1c10d1cb072c5cf477ebbfb5e7d1ab06f35bcc (diff) | |
download | cgeo-00436c5812fb9eec1a699740829830cbb65c9a6e.zip cgeo-00436c5812fb9eec1a699740829830cbb65c9a6e.tar.gz cgeo-00436c5812fb9eec1a699740829830cbb65c9a6e.tar.bz2 |
fix #3307: Coords in calendar is not usable
Diffstat (limited to 'cgeo-calendar')
-rw-r--r-- | cgeo-calendar/src/cgeo/calendar/AddEntry.java | 5 | ||||
-rw-r--r-- | cgeo-calendar/src/cgeo/calendar/AddEntryLevel14.java | 7 | ||||
-rw-r--r-- | cgeo-calendar/src/cgeo/calendar/CalendarEntry.java | 30 |
3 files changed, 10 insertions, 32 deletions
diff --git a/cgeo-calendar/src/cgeo/calendar/AddEntry.java b/cgeo-calendar/src/cgeo/calendar/AddEntry.java index b1f97b9..ce8658d 100644 --- a/cgeo-calendar/src/cgeo/calendar/AddEntry.java +++ b/cgeo-calendar/src/cgeo/calendar/AddEntry.java @@ -26,7 +26,6 @@ class AddEntry extends AbstractAddEntry { final Date eventDate = entry.parseDate(); final String description = entry.parseDescription(); - final String eventLocation = entry.parseLocation(); // values final ContentValues event = new ContentValues(); @@ -43,8 +42,8 @@ class AddEntry extends AbstractAddEntry { event.put("title", Html.fromHtml(entry.getName()).toString()); event.put("description", description); - if (eventLocation.length() > 0) { - event.put("eventLocation", eventLocation); + if (entry.getCoords().length() > 0) { + event.put("eventLocation", entry.getCoords()); } event.put("hasAlarm", 0); diff --git a/cgeo-calendar/src/cgeo/calendar/AddEntryLevel14.java b/cgeo-calendar/src/cgeo/calendar/AddEntryLevel14.java index 44453dd..b6a451e 100644 --- a/cgeo-calendar/src/cgeo/calendar/AddEntryLevel14.java +++ b/cgeo-calendar/src/cgeo/calendar/AddEntryLevel14.java @@ -20,7 +20,6 @@ class AddEntryLevel14 extends AbstractAddEntry { protected void addEntryToCalendarInternal() { final Date eventDate = entry.parseDate(); final String description = entry.parseDescription(); - final String eventLocation = entry.parseLocation(); /* * TODO These strings are available as constants starting with API 14 and can be used when @@ -32,8 +31,7 @@ class AddEntryLevel14 extends AbstractAddEntry { .putExtra("title", Html.fromHtml(entry.getName()).toString()) .putExtra("description", description) .putExtra("hasAlarm", false) - .putExtra("eventTimezone", "UTC") - .putExtra("eventLocation", eventLocation); + .putExtra("eventTimezone", "UTC"); if (entry.getStartTimeMinutes() >= 0) { intent.putExtra("beginTime", eventDate.getTime() + entry.getStartTimeMinutes() * 60000L); } @@ -41,6 +39,9 @@ class AddEntryLevel14 extends AbstractAddEntry { intent.putExtra("beginTime", eventDate.getTime() + 43200000); intent.putExtra("allDay", true); } + if (entry.getCoords().length() > 0) { + intent.putExtra("eventLocation", entry.getCoords()); + } activity.startActivity(intent); } diff --git a/cgeo-calendar/src/cgeo/calendar/CalendarEntry.java b/cgeo-calendar/src/cgeo/calendar/CalendarEntry.java index e31e054..6c7624d 100644 --- a/cgeo-calendar/src/cgeo/calendar/CalendarEntry.java +++ b/cgeo-calendar/src/cgeo/calendar/CalendarEntry.java @@ -20,7 +20,6 @@ class CalendarEntry { private String url; private String personalNote; private String name; - private String location; private String coords; private int startTimeMinutes = -1; private Uri uri; @@ -32,7 +31,6 @@ class CalendarEntry { this.url = getParameter(ICalendar.PARAM_URL); this.personalNote = getParameter(ICalendar.PARAM_NOTE); this.name = getParameter(ICalendar.PARAM_NAME); - location = getParameter(ICalendar.PARAM_LOCATION); coords = getParameter(ICalendar.PARAM_COORDS); final String startTime = getParameter(ICalendar.PARAM_START_TIME_MINUTES); if (startTime.length() > 0) { @@ -78,30 +76,6 @@ class CalendarEntry { } /** - * @return location string with coordinates and location - */ - protected String parseLocation() { - final StringBuilder locBuffer = new StringBuilder(); - if (coords.length() > 0) { - locBuffer.append(coords); - } - if (location.length() > 0) { - boolean addParentheses = false; - if (locBuffer.length() > 0) { - addParentheses = true; - locBuffer.append(" ("); - } - - locBuffer.append(Html.fromHtml(location).toString()); - if (addParentheses) { - locBuffer.append(')'); - } - } - - return locBuffer.toString(); - } - - /** * @return <code>Date</code> based on hidden date. Time is set to 00:00:00. */ protected Date parseDate() { @@ -153,4 +127,8 @@ class CalendarEntry { return startTimeMinutes; } + public String getCoords() { + return coords; + } + } |