Improved Calendar Support

Fixes previous CalDAV support, as MobileMe based calendars
now work ok. Additionally, a new 'id' field has been created
to provide a persistent and immutable identifier for a ride
file (regardless of changes to date/filename).

The URL provided in the Calendar config pane can now include
'@' symbols (they are translated to %40).

The CalDAV URL should be provided for a calendar collection and
not for a principal. Examples being (trailing slash is significant):

Google  : https://www.google.com/calendar/dav/xxxx@gmail.com/events/
MobileMe: https://cal.me.com:8443/calendars/users/x.xxxxxxxxxx/home/
This commit is contained in:
Mark Liversedge
2011-01-22 18:54:05 +00:00
parent c7b1c77fb7
commit 1fdf45d26d
13 changed files with 239 additions and 32 deletions

View File

@@ -64,6 +64,9 @@ GcFileReader::openRideFile(QFile &file, QStringList &errors) const
// now set in localtime
rideFile->setStartTime(asUTC.toLocalTime());
}
if (key == "Identifier") {
rideFile->setId(value);
}
}
// read in metric overrides:
@@ -186,6 +189,10 @@ GcFileReader::writeRideFile(const RideFile *ride, QFile &file) const
attributes.appendChild(attribute);
attribute.setAttribute("key", "Device type");
attribute.setAttribute("value", ride->deviceType());
attribute = doc.createElement("attribute");
attributes.appendChild(attribute);
attribute.setAttribute("key", "Identifier");
attribute.setAttribute("value", ride->id());
// write out in metric overrides:
// <override>