Switch to UTF-8 on .DLD export

Let's use the shiny new UTF-8 encoding on divelogs.de export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a simple table-based cns calculations

For dives where divecomputers haven't provided us with a cns, we
calculate our cns accumulated during that dive based on a simple table.

We also check if we did a dive in the prior 12 ours and grab the cns
from it and calculate how much of that still affects us.

[Dirk Hohndel: a couple of small changes: remove unnecessary check of cns
               values in the samples of the first dive computer, changed
	       the way we determine the 'previous dive' and used the end
	       time of that previous dive for the decay calculation]

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Retain event sort order on restart

The events that had same time stamp were reversed in order on every new
load of the log file. This patch will keep the order static. (Changing
order is annoying when using version control to store the logs.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
XSLT for importing individual DM4 dives

This XSLT can be used when exporting single dives from DM4 and importing
them to Subsurface.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A hook for DM4 XML import

This will take the DM4 XSLT into use.

In the future it is quite likely that we will have to start using
something more specific on top of the root element name to identify dive
log formats. But as "Dive" is currently a unique root element name for
us, this suffices for now.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>