OSDN Git Service

Correct problem moving conflicting notes on linked notebooks.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / threads / SyncRunner.java
index 1fcc42a..e46270c 100644 (file)
@@ -1364,7 +1364,9 @@ public class SyncRunner extends QObject implements Runnable {
                        newBook.setPublished(false);\r
                        \r
                        conn.getNotebookTable().addNotebook(newBook, false, true);\r
+                       notebookSignal.listChanged.emit();\r
                        notebookGuid = newBook.getGuid();\r
+                       refreshNeeded = true;\r
                }\r
                \r
                // Now that we have a good notebook guid, we need to move the conflicting note\r
@@ -1392,7 +1394,8 @@ public class SyncRunner extends QObject implements Runnable {
                conn.getNoteTable().updateNoteGuid(guid, newGuid);\r
                conn.getNoteTable().updateNoteNotebook(newGuid, notebookGuid, true);\r
                \r
-               \r
+               noteSignal.notebookChanged.emit(newGuid, notebookGuid);\r
+               refreshNeeded = true;\r
                noteSignal.guidChanged.emit(guid,newGuid);\r
        }\r
        \r
@@ -1790,6 +1793,7 @@ public class SyncRunner extends QObject implements Runnable {
        logger.log(logger.MEDIUM, "Authenticating Shared Notebooks");\r
        status.message.emit(tr("Synchronizing shared notebooks."));\r
        List<LinkedNotebook> books = conn.getLinkedNotebookTable().getAll();\r
+\r
        for (int i=0; i<books.size(); i++) {\r
                try {\r
                                long lastSyncDate = conn.getLinkedNotebookTable().getLastSequenceDate(books.get(i).getGuid());\r
@@ -1835,6 +1839,14 @@ public class SyncRunner extends QObject implements Runnable {
     //* Linked notebook contents (from someone else's account)\r
     //*************************************************************\r
        private void syncLinkedNotebook(LinkedNotebook book, int usn, int highSequence) {\r
+               \r
+               List<Note> dirtyNotes = conn.getNoteTable().getDirtyLinkedNotes();\r
+               if (dirtyNoteGuids == null) \r
+                       dirtyNoteGuids = new Vector<String>();\r
+\r
+               for (int i=0; i<dirtyNotes.size() && keepRunning; i++) {\r
+                       dirtyNoteGuids.add(dirtyNotes.get(i).getGuid());\r
+               }\r
                boolean fullSync = false;\r
                if (usn == 0)\r
                        fullSync = true;\r