OSDN Git Service

- Added support for note linking. It is still feels a little clunky but it seems...
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / threads / IndexRunner.java
index d5fb25c..d362f45 100644 (file)
@@ -680,6 +680,17 @@ public class IndexRunner extends QObject implements Runnable {
                                indexResource();\r
                        }\r
                }\r
+               \r
+               // Cleanup stuff that was deleted at some point\r
+               List<String> guids = conn.getWordsTable().getGuidList();\r
+               logger.log(logger.LOW, "GUIDS in index: " +guids.size());\r
+               for (int i=0; i<guids.size() && keepRunning; i++) {\r
+                       if (!conn.getNoteTable().exists(guids.get(i))) {\r
+                               logger.log(logger.LOW, "Old GUID found: " +guids.get(i));\r
+                               conn.getWordsTable().expunge(guids.get(i));\r
+                       }\r
+               }\r
+               \r
                if (started && keepRunning) \r
                        signal.indexFinished.emit();\r
        }\r