OSDN Git Service

Correct import error on older versions.
authorRandy Baumgarte <randy@fbn.cx>
Sat, 13 Oct 2012 11:09:07 +0000 (07:09 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sat, 13 Oct 2012 11:22:55 +0000 (07:22 -0400)
src/cx/fbn/nevernote/xml/ImportEnex.java

index 5736545..a3540b5 100644 (file)
@@ -186,6 +186,8 @@ public class ImportEnex {
                        if (reader.name().equalsIgnoreCase("resource") && reader.isEndElement())\r
                                atEnd = true;\r
                }\r
+               if (resource.getAttributes() == null) \r
+                       resource.setAttributes(new ResourceAttributes());\r
                conn.getNoteTable().noteResourceTable.updateNoteResource(resource, true);\r
                return resource;\r
        }\r
@@ -275,17 +277,15 @@ public class ImportEnex {
                boolean atEnd = false;\r
                while(!atEnd) {\r
                        if (reader.isStartElement()) {\r
-                               if (reader.name().equalsIgnoreCase("CameraMake")) \r
-                                       attributes.setCameraMake(textValue());          \r
-                               if (reader.name().equalsIgnoreCase("CameraModel")) \r
+                               if (reader.name().equalsIgnoreCase("camera-model")) \r
                                        attributes.setCameraModel(textValue());         \r
-                               if (reader.name().equalsIgnoreCase("FileName")) \r
+                               if (reader.name().equalsIgnoreCase("file-name")) \r
                                        attributes.setFileName(textValue());            \r
-                               if (reader.name().equalsIgnoreCase("RecoType")) \r
+                               if (reader.name().equalsIgnoreCase("reco-type")) \r
                                        attributes.setRecoType(textValue());            \r
-                               if (reader.name().equalsIgnoreCase("CameraModel")) \r
+                               if (reader.name().equalsIgnoreCase("camera-make")) \r
                                        attributes.setCameraMake(textValue());          \r
-                               if (reader.name().equalsIgnoreCase("SourceURL")) \r
+                               if (reader.name().equalsIgnoreCase("source-url")) \r
                                        attributes.setSourceURL(textValue());           \r
                                if (reader.name().equalsIgnoreCase("Altitude")) \r
                                        attributes.setAltitude(doubleValue());          \r