OSDN Git Service

Add Linked notebooks to the ignore sync process.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteTable.java
index 97c0b15..bd2ab8e 100644 (file)
@@ -976,7 +976,7 @@ public class NoteTable {
        }\r
        \r
        // Expunge notes that we don't want to synchronize\r
        }\r
        \r
        // Expunge notes that we don't want to synchronize\r
-       public List<String> expungeIgnoreSynchronizedNotes(List<String> notebooks, List<String>tags) {\r
+       public List<String> expungeIgnoreSynchronizedNotes(List<String> notebooks, List<String>tags, List<String> linked) {\r
                \r
                List<String> noteGuids = new ArrayList<String>();\r
                for (int i=0; i<notebooks.size(); i++) {\r
                \r
                List<String> noteGuids = new ArrayList<String>();\r
                for (int i=0; i<notebooks.size(); i++) {\r
@@ -998,6 +998,23 @@ public class NoteTable {
                                }\r
                        }\r
                }\r
                                }\r
                        }\r
                }\r
+               \r
+               for (int i=0; i<linked.size(); i++) {\r
+                       String notebookGuid = db.getLinkedNotebookTable().getNotebookGuid(linked.get(i));\r
+                       if (notebookGuid != null && !notebookGuid.trim().equals("")) {\r
+                               List<Tag> linkedTags = db.getTagTable().getTagsForNotebook(notebookGuid);\r
+                               for (int j=0; j<linkedTags.size(); j++)\r
+                                       db.getTagTable().expungeTag(linkedTags.get(j).getGuid(), false);\r
+                               \r
+                               List<String> notes = findNotesByNotebook(notebookGuid);\r
+                               for (int j=0; j<notes.size(); j++) {\r
+                                       if (!isNoteDirty(notes.get(j))) {\r
+                                               expungeNote(notes.get(j), true, false);\r
+                                               noteGuids.add(notes.get(j));\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
                return noteGuids;\r
        }\r
        \r
                return noteGuids;\r
        }\r
        \r