OSDN Git Service

Set notebook as dirty when default notebook changes.
authorRandy Baumgarte <randy@fbn.cx>
Tue, 20 Mar 2012 15:40:04 +0000 (11:40 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Tue, 20 Mar 2012 15:40:04 +0000 (11:40 -0400)
src/cx/fbn/nevernote/sql/NotebookTable.java

index 5e88726..43cf18b 100644 (file)
@@ -561,10 +561,10 @@ public class NotebookTable {
        public void setDefaultNotebook(String guid) {\r
                NSqlQuery query = new NSqlQuery(db.getConnection());\r
                \r
        public void setDefaultNotebook(String guid) {\r
                NSqlQuery query = new NSqlQuery(db.getConnection());\r
                \r
-               query.prepare("Update "+dbName+" set defaultNotebook=false where linked=false");\r
+               query.prepare("Update "+dbName+" set defaultNotebook=false, isDirty=true where linked=false and defaultNotebook=true");\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error removing default "+dbName+".");\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error removing default "+dbName+".");\r
-               query.prepare("Update "+dbName+" set defaultNotebook=true where guid=:guid and linked=false");\r
+               query.prepare("Update "+dbName+" set defaultNotebook=true, isDirty=true where guid=:guid and linked=false");\r
                query.bindValue(":guid", guid);\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error setting default "+dbName+".");\r
                query.bindValue(":guid", guid);\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error setting default "+dbName+".");\r