]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Add weight and suit support for JDiveLog import
authorMiika Turkia <miika.turkia@gmail.com>
Sat, 18 Aug 2012 16:33:40 +0000 (19:33 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2012 16:53:32 +0000 (09:53 -0700)
Use the suit and weightsystem support of Subsurface when importing
divelogs from JDiveLog. (They were previously included in the notes
field as support for these fields was missing from Subsurface.)

After import the weightsystem is undefined and weight unit is the
default of Subsurface. Unfortunately the weight field in JDiveLog is
text field and might contain pounds and kilograms mixed in seemingly
random order. Thus 2 pounds of weight might be transformed to 2 kg.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
xslt/jdivelog2subsurface.xslt

index e2f40c560c5d7fcc4eb135781835d8cbecc39cc6..6e85cbfbce07e91ceefeca4e7c8a66750a0ffa02 100644 (file)
         </buddy>
       </xsl:if>
 
+      <xsl:if test="Equipment/Suit != ''">
+       <suit>
+          <xsl:value-of select="Equipment/Suit"/>
+       </suit>
+        <xsl:value-of select="Equipment/Suit"/>
+      </xsl:if>
+
+      <xsl:if test="Equipment/Weight != ''">
+        <weightsystem>
+          <xsl:attribute name="weight">
+            <xsl:value-of select="Equipment/Weight"/>
+          </xsl:attribute>
+        </weightsystem>
+      </xsl:if>
+
       <notes>
         <xsl:if test="DiveActivity != ''">
 Diveactivity: <xsl:value-of select="DiveActivity"/>
@@ -73,15 +88,9 @@ Divetype: <xsl:value-of select="DiveType"/>
         </xsl:if>
         <xsl:if test="Equipment/Visibility != ''">
 Visibility: <xsl:value-of select="Equipment/Visibility"/>
-        </xsl:if>
-        <xsl:if test="Equipment/Suit != ''">
-Suit: <xsl:value-of select="Equipment/Suit"/>
         </xsl:if>
         <xsl:if test="Equipment/Gloves != ''">
 Gloves: <xsl:value-of select="Equipment/Gloves"/>
-        </xsl:if>
-        <xsl:if test="Equipment/Weight != ''">
-Weight: <xsl:value-of select="Equipment/Weight"/>
         </xsl:if>
         <xsl:if test="Comment != ''">
 Comment: <xsl:value-of select="Comment"/>