OSDN Git Service

Correct tag sort order on note list.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteTable.java
index 92cc548..54da38b 100644 (file)
@@ -151,6 +151,16 @@ public class NoteTable {
                        query.bindValue(":attributeSource", n.getAttributes().getSource());\r
                        query.bindValue(":attributeSourceUrl", n.getAttributes().getSourceURL());\r
                        query.bindValue(":attributeSourceApplication", n.getAttributes().getSourceApplication());\r
+               } else {\r
+                       created = new StringBuilder(simple.format(n.getCreated()));     \r
+                       query.bindValue(":attributeSubjectDate", created.toString());\r
+                       query.bindValue(":attributeLatitude", 0.0);\r
+                       query.bindValue(":attributeLongitude", 0.0);\r
+                       query.bindValue(":attributeAltitude", 0.0);\r
+                       query.bindValue(":attributeAuthor", "");\r
+                       query.bindValue(":attributeSource", "");\r
+                       query.bindValue(":attributeSourceUrl", "");\r
+                       query.bindValue(":attributeSourceApplication", "");\r
                }\r
                query.bindValue(":indexNeeded", true);\r
                query.bindValue(":isExpunged", false);\r
@@ -299,18 +309,20 @@ public class NoteTable {
                na.setContentClass(query.valueString(16));\r
                \r
                if (loadTags) {\r
-                       n.setTagGuids(noteTagsTable.getNoteTags(n.getGuid()));\r
+                       List<String> tagGuids = noteTagsTable.getNoteTags(n.getGuid());\r
                        List<String> tagNames = new ArrayList<String>();\r
                        TagTable tagTable = db.getTagTable();\r
-                       for (int i=0; i<n.getTagGuids().size(); i++) {\r
-                               String currentGuid = n.getTagGuids().get(i);\r
+                       for (int i=0; i<tagGuids.size(); i++) {\r
+                               String currentGuid = tagGuids.get(i);\r
                                Tag tag = tagTable.getTag(currentGuid);\r
                                if (tag.getName() != null)\r
                                        tagNames.add(tag.getName());\r
                                else\r
                                        tagNames.add("");\r
                        }\r
+\r
                        n.setTagNames(tagNames);\r
+                       n.setTagGuids(tagGuids);                \r
                }\r
                \r
                if (loadContent) {\r