OSDN Git Service

Cleanup compiler warning messages and alter backup & restore to handle new database...
authorRandy Baumgarte <randy@fbn.cx>
Mon, 15 Nov 2010 19:56:32 +0000 (14:56 -0500)
committerRandy Baumgarte <randy@fbn.cx>
Wed, 15 Dec 2010 15:16:15 +0000 (10:16 -0500)
26 files changed:
src/cx/fbn/nevernote/Global.java
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/config/FileManager.java
src/cx/fbn/nevernote/dialog/ConfigFontPage.java
src/cx/fbn/nevernote/dialog/NotebookEdit.java
src/cx/fbn/nevernote/dialog/SetIcon.java
src/cx/fbn/nevernote/dialog/SpellCheck.java
src/cx/fbn/nevernote/evernote/EnmlConverter.java
src/cx/fbn/nevernote/filters/DateAttributeFilter.java
src/cx/fbn/nevernote/filters/NoteSortFilterProxyModel.java
src/cx/fbn/nevernote/gui/AttributeTreeWidget.java
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/ContainsAttributeFilterTable.java
src/cx/fbn/nevernote/gui/ExternalBrowse.java
src/cx/fbn/nevernote/gui/NotebookTreeWidget.java
src/cx/fbn/nevernote/gui/Thumbnailer.java
src/cx/fbn/nevernote/icons/books2.png
src/cx/fbn/nevernote/signals/NoteSignal.java
src/cx/fbn/nevernote/sql/DatabaseConnection.java
src/cx/fbn/nevernote/sql/LinkedNotebookTable.java
src/cx/fbn/nevernote/sql/NotebookTable.java
src/cx/fbn/nevernote/sql/SharedNotebookTable.java
src/cx/fbn/nevernote/sql/TagTable.java
src/cx/fbn/nevernote/utilities/Base64.java
src/cx/fbn/nevernote/xml/ExportData.java
src/cx/fbn/nevernote/xml/ImportData.java

index 29cdf28..2581e33 100644 (file)
@@ -74,7 +74,7 @@ public class Global {
     public static QSize largeThumbnailSize = new QSize(300,225);\r
 //    public static boolean listView = true;\r
     \r
-    public static HashMap<String,Pair> passwordSafe = new HashMap<String, Pair>();\r
+    public static HashMap<String,Pair<String,String>> passwordSafe = new HashMap<String, Pair<String,String>>();\r
     public static List<Pair<String,String>> passwordRemember = new ArrayList<Pair<String,String>>();\r
     public static String currentNotebookGuid;\r
     public static User user; \r
index 1ba1cfb..49505d1 100644 (file)
@@ -310,6 +310,7 @@ public class NeverNote extends QMainWindow{
     //***************************************************************
     //***************************************************************
     // Application Constructor 
+       @SuppressWarnings("static-access")
        public NeverNote(DatabaseConnection dbConn)  {
                conn = dbConn;          
                if (conn.getConnection() == null) {
@@ -1604,6 +1605,7 @@ public class NeverNote extends QMainWindow{
                browserWindow.setNotebookList(nbooks);
        }
        // Change the notebook's icon
+       @SuppressWarnings("unused")
        private void setNotebookIcon() {
                boolean stackSelected = false;
                boolean allNotebookSelected = false;
@@ -1714,6 +1716,7 @@ public class NeverNote extends QMainWindow{
                
                logger.log(logger.HIGH, "Leaving NeverNote.addTag");
        }
+       @SuppressWarnings("unused")
        private void reloadTagTree() {
                reloadTagTree(false);
        }
@@ -1998,6 +2001,7 @@ public class NeverNote extends QMainWindow{
        tagTree.blockSignals(false);
        }
        // Change the icon for a tag
+       @SuppressWarnings("unused")
        private void setTagIcon() {
                QTreeWidgetItem currentSelection;
                List<QTreeWidgetItem> selections = tagTree.selectedItems();
@@ -2232,6 +2236,7 @@ public class NeverNote extends QMainWindow{
        logger.log(logger.HIGH, "Leaving NeverNote.toggleSavedSearchWindow");
     }
        // Change the icon for a saved search
+       @SuppressWarnings("unused")
        private void setSavedSearchIcon() {
                QTreeWidgetItem currentSelection;
                List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
@@ -3352,6 +3357,7 @@ public class NeverNote extends QMainWindow{
        }
        logger.log(logger.HIGH, "Leaving NeverNote.updateListAuthor");
     }
+       @SuppressWarnings("unused")
        private void updateListGuid(String oldGuid, String newGuid) {
        logger.log(logger.HIGH, "Entering NeverNote.updateListTitle");
 
@@ -3469,7 +3475,6 @@ public class NeverNote extends QMainWindow{
        }
        logger.log(logger.HIGH, "Leaving NeverNote.updateListDateCreated");
     }
-    @SuppressWarnings("unused")
        private void updateListDateChanged(String guid, QDateTime date) {
        logger.log(logger.HIGH, "Entering NeverNote.updateListDateChanged");
 
@@ -3494,7 +3499,6 @@ public class NeverNote extends QMainWindow{
        logger.log(logger.HIGH, "Leaving NeverNote.updateListDateChanged");
     }  
     // Redo scroll
-    @SuppressWarnings("unused")
        private void scrollToCurrentGuid() {
        //scrollToGuid(currentNoteGuid);
        List<QModelIndex> selections = noteTableView.selectionModel().selectedRows();
@@ -3647,7 +3651,6 @@ public class NeverNote extends QMainWindow{
     //** External editor window functions                    
     //***************************************************************
     //***************************************************************
-    @SuppressWarnings("unused")
        private void listDoubleClick() {
        saveNote();
        if (externalWindows.containsKey(currentNoteGuid)) {
@@ -3679,7 +3682,7 @@ public class NeverNote extends QMainWindow{
                browserWindow.setTitle(text);
        }
     }
-    @SuppressWarnings("unused")
+    @SuppressWarnings({ "rawtypes", "unused" })
        private void externalWindowTagsEdited(String guid, List values) {
        StringBuffer line = new StringBuffer(100);
        for (int i=0; i<values.size(); i++) {
@@ -4186,7 +4189,8 @@ public class NeverNote extends QMainWindow{
        browserWindow.getBrowser().page().findText(find.getText(), find.getFlags());
        find.setFocus();
     }
-    private void updateNoteTitle(String guid, String title) {
+    @SuppressWarnings("unused")
+       private void updateNoteTitle(String guid, String title) {
        listManager.setNoteSynchronized(guid, false);
     }
     // Signal received that note content has changed.  Normally we just need the guid to remove
@@ -4322,6 +4326,7 @@ public class NeverNote extends QMainWindow{
                waitCursor(false);
        }
        // View all notes
+       @SuppressWarnings("unused")
        private void allNotes() {
                clearAttributeFilter();
                clearNotebookFilter();
index ec3bee3..eda582b 100644 (file)
@@ -319,7 +319,8 @@ public class FileManager {
     /**
      * @throws InitializationException if non-existent, bad file permissions, or a file instead of a directory
      */
-    private static void checkExistingWriteableDir(File dir) throws InitializationException {
+    @SuppressWarnings("unused")
+       private static void checkExistingWriteableDir(File dir) throws InitializationException {
         checkExistingReadableDir(dir);
         if (!dir.canWrite()) {
             throw new InitializationException("Directory '" + dir + "' does not have write permission");
index d1abd4c..a520eca 100644 (file)
@@ -110,11 +110,13 @@ public class ConfigFontPage extends QWidget {
 \r
        }\r
        \r
+       @SuppressWarnings("unused")\r
        private void fontSelected(String font) {\r
                this.font = font;\r
                loadFontSize(font);\r
        }\r
        \r
+       @SuppressWarnings("unused")\r
        private void fontSizeSelected(String size) {\r
                this.fontSize = size;\r
        }\r
index 3e8c3cb..4b349bb 100644 (file)
@@ -159,6 +159,7 @@ public class NotebookEdit extends QDialog {
        }
        
        // Action when the default notebook icon is checked
+       @SuppressWarnings("unused")
        private void defaultNotebookChecked(Boolean val) {
                if (val != startDefault || !startText.equals(notebook.text())) 
                        ok.setEnabled(true);
index daf30bd..603a54c 100644 (file)
@@ -91,6 +91,7 @@ public class SetIcon extends QDialog {
        }
        
        // Icon Button pressed
+       @SuppressWarnings("unused")
        private void iconButtonPressed() {
                QFileDialog fd = new QFileDialog(this);
                fd.setFileMode(FileMode.ExistingFile);
@@ -105,7 +106,6 @@ public class SetIcon extends QDialog {
                
                ok.setEnabled(true);
                String path = fd.selectedFiles().get(0);
-               QIcon icon = new QIcon(path);
                iconButton.setIcon(new QIcon(path));
                iconButton.setSizePolicy(Policy.Fixed, Policy.Fixed);
        }
index 17bac03..cbc4c87 100644 (file)
@@ -158,18 +158,21 @@ public class SpellCheck extends QDialog {
                        return;\r
                }\r
                \r
+               @SuppressWarnings("unchecked")\r
                List<Word> values = checker.getSuggestions(replacementWord.text(), 10);\r
                for (int i=0; i<values.size(); i++) {\r
                        suggestions.addItem(values.get(i).toString());\r
                }\r
        }\r
        \r
+       @SuppressWarnings("unused")\r
        private void replacementChosen() {\r
                String sel = suggestions.currentItem().text();\r
                replacementWord.setText(sel);\r
        }\r
        \r
        //Add an item to the dictionary\r
+       @SuppressWarnings("unused")\r
        private void addToDictionaryButtonPressed() {\r
                checker.addToDictionary(misspelledWord);\r
                this.close();\r
index f4570be..8b82196 100644 (file)
@@ -247,9 +247,7 @@ public class EnmlConverter {
                        String text = newContent.substring(startPos,endData);\r
                        endPos = newContent.indexOf("</table>",i+1)+8;\r
                        // Encrypt the text\r
-                       Pair<String,String> pair;\r
-                       Pair pair2 = Global.passwordSafe.get(slot);\r
-                       pair = pair2;\r
+                       Pair<String,String> pair = Global.passwordSafe.get(slot);\r
                        String password = pair.getFirst();\r
                        String hint = pair.getSecond();\r
                        EnCrypt crypt = new EnCrypt(); \r
index fdef3a8..732b6d8 100644 (file)
 package cx.fbn.nevernote.filters;\r
 \r
 import java.text.SimpleDateFormat;\r
-import com.trolltech.qt.core.QDateTime;\r
 \r
 import com.evernote.edam.type.Note;\r
-\r
-import cx.fbn.nevernote.filters.AttributeFilter;\r
+import com.trolltech.qt.core.QDateTime;\r
 \r
 public abstract class DateAttributeFilter extends AttributeFilter {\r
     protected boolean checkSince;\r
-    private boolean checkCreated;\r
+    private final boolean checkCreated;\r
 \r
     public DateAttributeFilter (boolean since, boolean created) {\r
        super();\r
@@ -36,10 +34,10 @@ public abstract class DateAttributeFilter extends AttributeFilter {
        checkCreated=created;\r
     }\r
 \r
-    public abstract boolean attributeCheck(Note n);\r
+    @Override\r
+       public abstract boolean attributeCheck(Note n);\r
 \r
     protected QDateTime noteTime(Note n) {\r
-        QDateTime noteDate;\r
         String dateTimeFormat = new String("MM/dd/yyyy HH:mm:ss");\r
         SimpleDateFormat simple = new SimpleDateFormat(dateTimeFormat);\r
 \r
@@ -53,7 +51,6 @@ public abstract class DateAttributeFilter extends AttributeFilter {
     }\r
 \r
     protected QDateTime currentTime() {\r
-        QDateTime current = new QDateTime();\r
         return QDateTime.currentDateTime();\r
     }\r
 }\r
index bb17512..4510ffd 100644 (file)
@@ -33,12 +33,10 @@ import cx.fbn.nevernote.Global;
 \r
 public class NoteSortFilterProxyModel extends QSortFilterProxyModel {\r
        private final Map<String,String> guids;\r
-       private String dateFormat;\r
        \r
        public NoteSortFilterProxyModel(QObject parent) {\r
                super(parent);\r
                guids = new HashMap<String,String>();\r
-               dateFormat = Global.getDateFormat() + " " + Global.getTimeFormat();\r
                setDynamicSortFilter(true);\r
 //             logger = new ApplicationLogger("filter.log");\r
        }\r
@@ -50,7 +48,6 @@ public class NoteSortFilterProxyModel extends QSortFilterProxyModel {
                        guids.put(guid, null);\r
        }\r
        public void filter() {\r
-               dateFormat = Global.getDateFormat() + " " + Global.getTimeFormat();\r
                invalidateFilter();\r
        }\r
        @Override\r
index 381d1b1..5ebf260 100644 (file)
@@ -21,8 +21,6 @@
 package cx.fbn.nevernote.gui;\r
 \r
 import com.trolltech.qt.core.Qt;\r
-import com.trolltech.qt.core.Qt.ItemDataRole;\r
-\r
 import com.trolltech.qt.gui.QAbstractItemView;\r
 import com.trolltech.qt.gui.QIcon;\r
 import com.trolltech.qt.gui.QTreeWidget;\r
index 3368242..51ea0ea 100644 (file)
@@ -249,7 +249,8 @@ public class BrowserWindow extends QWidget {
                        errorsFound = true;\r
                        spellCheckDialog.setWord(event.getInvalidWord());\r
 \r
-                   List<Word> suggestions = event.getSuggestions();\r
+                   @SuppressWarnings("unchecked")\r
+                       List<Word> suggestions = event.getSuggestions();\r
                    spellCheckDialog.clearSuggestions();\r
                    if (!suggestions.isEmpty()) {\r
 //                    spellCheckDialog.setCurrentSuggestion(suggestions.get(0).getWord());\r
@@ -1377,7 +1378,6 @@ public class BrowserWindow extends QWidget {
                        plainText = crypt.decrypt(text, Global.passwordRemember.get(i).getFirst(), 64);\r
                        if (plainText != null) {\r
                                slot = new String(Long.toString(l));\r
-                               Pair<String,String> passwordPair = new Pair<String,String>();\r
                                Global.passwordSafe.put(slot, Global.passwordRemember.get(i));\r
                                removeEncryption(id, plainText, false, slot);   \r
                                return;\r
@@ -2617,94 +2617,117 @@ public class BrowserWindow extends QWidget {
        }\r
 */\r
        \r
+       @SuppressWarnings("unused")\r
        private void toggleUndoVisible(Boolean toggle) {\r
                undoAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("undo", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleRedoVisible(Boolean toggle) {\r
                redoAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("redo", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleCutVisible(Boolean toggle) {\r
                cutAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("cut", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleCopyVisible(Boolean toggle) {\r
                copyAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("copy", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void togglePasteVisible(Boolean toggle) {\r
                pasteAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("paste", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleBoldVisible(Boolean toggle) {\r
                boldAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("bold", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleItalicVisible(Boolean toggle) {\r
                italicAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("italic", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleUnderlineVisible(Boolean toggle) {\r
                underlineAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("underline", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleStrikethroughVisible(Boolean toggle) {\r
                strikethroughAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("strikethrough", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleLeftAlignVisible(Boolean toggle) {\r
                leftAlignAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("alignLeft", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleRightAlignVisible(Boolean toggle) {\r
                rightAlignAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("alignRight", toggle);\r
        }       \r
+       @SuppressWarnings("unused")\r
        private void toggleCenterAlignVisible(Boolean toggle) {\r
                centerAlignAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("alignCenter", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleHLineVisible(Boolean toggle) {\r
                hlineAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("hline", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleIndentVisible(Boolean toggle) {\r
                indentAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("indent", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleTodoVisible(Boolean toggle) {\r
                todoAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("todo", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleOutdentVisible(Boolean toggle) {\r
                outdentAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("outdent", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleBulletListVisible(Boolean toggle) {\r
                bulletListAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("bulletList", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleNumberListVisible(Boolean toggle) {\r
                numberListAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("numberList", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleFontListVisible(Boolean toggle) {\r
                fontListAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("font", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleFontColorVisible(Boolean toggle) {\r
                fontColorAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("fontColor", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleFontSizeVisible(Boolean toggle) {\r
                fontSizeAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("fontSize", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleFontHilightVisible(Boolean toggle) {\r
                fontHilightAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("fontHilight", toggle);\r
        }\r
+       @SuppressWarnings("unused")\r
        private void toggleSpellCheckVisible(Boolean toggle) {\r
                spellCheckAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("spellCheck", toggle);\r
@@ -2750,6 +2773,7 @@ public class BrowserWindow extends QWidget {
        }\r
        \r
        // Invoke spell checker dialog\r
+       @SuppressWarnings("unused")\r
        private void spellCheckClicked() {\r
 \r
                if (spellChecker == null) {\r
index acbd14a..24a3377 100644 (file)
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 \r
 import com.evernote.edam.type.Note;\r
 \r
-import cx.fbn.nevernote.filters.AttributeFilter;\r
 import cx.fbn.nevernote.filters.ContainsAttributeFilter;\r
 import cx.fbn.nevernote.filters.ContainsAttributeFilterFactory;\r
 import cx.fbn.nevernote.sql.NoteTable;\r
index b0b63c8..f2acd41 100644 (file)
@@ -49,6 +49,7 @@ public class ExternalBrowse extends QMdiSubWindow {
                browser.getBrowser().page().contentsChanged.connect(this, "contentChanged()");\r
        }\r
        \r
+       @SuppressWarnings("unused")\r
        private void contentChanged() {\r
                noteDirty = true;\r
                contentsChanged.emit(getBrowserWindow().getNote().getGuid(), getBrowserWindow().getContent(), false, getBrowserWindow());\r
@@ -66,10 +67,12 @@ public class ExternalBrowse extends QMdiSubWindow {
        return browser;\r
     }\r
     \r
-    private void titleChanged(String value) {\r
+    @SuppressWarnings("unused")\r
+       private void titleChanged(String value) {\r
        setWindowTitle(tr("NeverNote - ") +value);\r
     }\r
     \r
+       @SuppressWarnings("unused")\r
        private void updateTitle(String guid, String title) {\r
                if (guid.equals(getBrowserWindow().getNote().getGuid())) {\r
                        getBrowserWindow().loadingData(true);\r
@@ -78,6 +81,7 @@ public class ExternalBrowse extends QMdiSubWindow {
                        getBrowserWindow().loadingData(false);\r
                }\r
        }\r
+       @SuppressWarnings("unused")\r
        private void updateNotebook(String guid, String notebook) {\r
                if (guid.equals(getBrowserWindow().getNote().getGuid())) {\r
                        getBrowserWindow().loadingData(true);\r
@@ -86,6 +90,7 @@ public class ExternalBrowse extends QMdiSubWindow {
                }\r
        }\r
        \r
+       @SuppressWarnings("unused")\r
        private void updateTags(String guid, List<String> tags) {\r
                if (guid.equals(getBrowserWindow().getNote().getGuid())) {\r
                        StringBuffer tagLine = new StringBuffer(100);\r
index 80e8263..e0d9763 100644 (file)
@@ -56,7 +56,6 @@ public class NotebookTreeWidget extends QTreeWidget {
        public NoteSignal                               noteSignal;\r
        private HashMap<String, QIcon>  icons;\r
        private final DatabaseConnection                db;\r
-       private List<NotebookCounter> lastCounts;\r
        private final HashMap<String, QTreeWidgetItem>  stacks;\r
 //     private final QTreeWidgetItem                   previousMouseOver;\r
 //     private boolean                                 previousMouseOverWasSelected;\r
@@ -221,7 +220,6 @@ public class NotebookTreeWidget extends QTreeWidget {
 \r
        // update the display with the current number of notes\r
        public void updateCounts(List<Notebook> books, List<NotebookCounter> counts) {\r
-               lastCounts = counts;\r
                QTreeWidgetItem root = invisibleRootItem();\r
                QTreeWidgetItem child;\r
                \r
index 4381275..2c9e82a 100644 (file)
@@ -30,8 +30,6 @@ public class Thumbnailer extends QObject {
     private final QSize size;\r
     private int zoom;\r
     private QBuffer buffer;\r
-    private final ListManager listManager;\r
-    private final ThumbnailRunner runner;\r
     private final ApplicationLogger logger;\r
     private final DatabaseConnection conn;\r
     \r
@@ -40,10 +38,8 @@ public class Thumbnailer extends QObject {
        mutex = new QMutex();\r
        zoom = 1;\r
 \r
-       this.runner = r;\r
        this.logger = logger;\r
        page = new QWebPage();\r
-       listManager = l;\r
        this.conn = conn;\r
         size = new QSize(1024,768);\r
 //        size = new QSize();\r
@@ -65,6 +61,7 @@ public class Thumbnailer extends QObject {
     }\r
 \r
     \r
+       @SuppressWarnings("unused")\r
        private String loadFinished(Boolean ok) {\r
                if (!ok) { \r
                        mutex.unlock();\r
index 92cd6af..a6250ff 100644 (file)
Binary files a/src/cx/fbn/nevernote/icons/books2.png and b/src/cx/fbn/nevernote/icons/books2.png differ
index 2062457..9f14403 100644 (file)
@@ -27,8 +27,7 @@ import com.trolltech.qt.core.QDateTime;
 \r
 \r
 public class NoteSignal extends QSignalEmitter {\r
-       @SuppressWarnings("unchecked")\r
-       public Signal2<String, List>            tagsChanged = new Signal2<String, List>(); \r
+       public Signal2<String, List<String>>            tagsChanged = new Signal2<String, List<String>>(); \r
        public Signal2<String, String>          tagsAdded = new Signal2<String, String>();\r
        public Signal2<String, String>          titleChanged = new Signal2<String, String>();\r
        public Signal2<String, String>          noteChanged = new Signal2<String, String>();\r
index 3565e58..6d9eab6 100644 (file)
@@ -149,6 +149,7 @@ public class DatabaseConnection {
                        executeSql("alter table notebook add column publishingPublicDescription varchar");
                        executeSql("alter table notebook add column stack varchar");
                        executeSql("alter table notebook add column icon blob");
+                       executeSql("alter table notebook add column readOnly boolean");
                        executeSql("alter table tag add column icon blob");
                        executeSql("alter table SavedSearch add column icon blob");
 
@@ -158,7 +159,7 @@ public class DatabaseConnection {
                        executeSql("create index RESOURCES_GUID_INDEX on noteresources (noteGuid, guid);");
                        executeSql("update note set thumbnailneeded=true, thumbnail=null;");
                        executeSql("update notebook set publishingUri='', " +
-                                       "publishingAscending=false, stack='', publishingOrder=1, " +
+                                       "publishingAscending=false, stack='', readonly=false, publishingOrder=1, " +
                                        "publishingPublicDescription=''");
                        
                        sharedNotebookTable.createTable();
@@ -166,6 +167,7 @@ public class DatabaseConnection {
                        systemIconTable.createTable();
                        
                        version = "0.95";
+                       executeSql("Insert into Sync (key, value) values ('FullNotebookSync', 'true')");
                        executeSql("Insert into Sync (key, value) values ('FullLinkedNotebookSync', 'true')");
                        executeSql("Insert into Sync (key, value) values ('FullSharedNotebookSync', 'true')");
                        Global.setDatabaseVersion(version);
index 8589119..71a1633 100644 (file)
@@ -190,6 +190,21 @@ public class LinkedNotebookTable {
                return val;\r
        }\r
 \r
+       \r
+       // Get a list of linked notebooks that need to be updated\r
+       public List<String> getDirtyGuids() {\r
+               List<String> index = new ArrayList<String>();\r
+               boolean check;  \r
+        NSqlQuery query = new NSqlQuery(db.getConnection());\r
+                                       \r
+               check = query.exec("Select id from LinkedNotebook where isDirty = true");\r
+               if (!check) \r
+                       logger.log(logger.EXTREME, "LinkedNotebook SQL retrieve has failed in getdirtyIds.");\r
+               while (query.next()) {\r
+                       index.add(query.valueString(0));\r
+               }       \r
+               return index;   \r
+       }\r
 \r
 }\r
 \r
index 807fb90..647967e 100644 (file)
@@ -64,7 +64,6 @@ public class NotebookTable {
                        "published boolean, "+\r
                        "isDirty boolean, "+\r
                        "autoEncrypt boolean, "+\r
-                       "readOnly boolean, " +\r
                        "local boolean, "+\r
                        "archived boolean)"))                           \r
                logger.log(logger.HIGH, "Table Notebook creation FAILED!!!");   \r
@@ -79,11 +78,11 @@ public class NotebookTable {
         query = new NSqlQuery(db.getConnection());\r
                query.prepare("Insert Into Notebook (guid, sequence, name, defaultNotebook, "\r
                                +"serviceCreated, serviceUpdated, published, "   \r
-                               + "isDirty, autoEncrypt, readOnly, \r
+                               + "isDirty, autoEncrypt, " \r
                                + "local, archived) Values("\r
                                +":guid, :sequence, :name, :defaultNotebook,  "\r
                                +":serviceCreated, :serviceUpdated, :published, "\r
-                               +":isDirty, :autoEncrypt, :readOnly, "\r
+                               +":isDirty, :autoEncrypt, "\r
                                +":local, false)");\r
                query.bindValue(":guid", newnote.getGuid());\r
                query.bindValue(":sequence", newnote.getUpdateSequenceNum());\r
@@ -101,7 +100,6 @@ public class NotebookTable {
                query.bindValue(":isDirty", true);\r
                query.bindValue(":autoEncrypt", false);\r
                query.bindValue(":local", false);\r
-               query.bindValue(":readOnly", false);\r
 \r
                boolean check = query.exec();\r
                if (!check) {\r
@@ -552,6 +550,21 @@ public class NotebookTable {
                QIcon icon = new QIcon(QPixmap.fromImage(QImage.fromData(blob)));\r
                return icon;\r
        }\r
+       // Get the notebooks custom icon\r
+       public QByteArray getIconAsByteArray(String guid) {\r
+               NSqlQuery query = new NSqlQuery(db.getConnection());\r
+               \r
+               if (!query.prepare("Select icon from notebook where guid=:guid"))\r
+                       logger.log(logger.EXTREME, "Error preparing notebook icon select.");\r
+               query.bindValue(":guid", guid);\r
+               if (!query.exec())\r
+                       logger.log(logger.EXTREME, "Error finding notebook icon.");\r
+               if (!query.next() || query.getBlob(0) == null)\r
+                       return null;\r
+               \r
+               QByteArray blob = new QByteArray(query.getBlob(0));\r
+               return blob;\r
+       }\r
        // Set the notebooks custom icon\r
        public void setIcon(String guid, QIcon icon, String type) {\r
                NSqlQuery query = new NSqlQuery(db.getConnection());\r
index e3d8393..aed7f46 100644 (file)
@@ -209,6 +209,21 @@ public class SharedNotebookTable {
                return index;\r
        }                       \r
 \r
+       \r
+       // Get a list of shared notebooks that need to be updated\r
+       public List <Long> getDirtyIds() {\r
+               List<Long> index = new ArrayList<Long>();\r
+               boolean check;  \r
+        NSqlQuery query = new NSqlQuery(db.getConnection());\r
+                                       \r
+               check = query.exec("Select id from SharedNotebook where isDirty = true");\r
+               if (!check) \r
+                       logger.log(logger.EXTREME, "SharedNotebook SQL retrieve has failed in getdirtyIds.");\r
+               while (query.next()) {\r
+                       index.add(query.valueLong(0));\r
+               }       \r
+               return index;   \r
+       }\r
 \r
 }\r
 \r
index aaaf30e..102e5cc 100644 (file)
@@ -38,7 +38,6 @@ import cx.fbn.nevernote.utilities.ApplicationLogger;
 public class TagTable {\r
        private final ApplicationLogger logger;\r
        DatabaseConnection db;\r
-       private HashMap<String, QIcon>  icons;\r
 \r
        public TagTable (ApplicationLogger l, DatabaseConnection d) {\r
                logger = l;\r
index 228cf79..dc34cfb 100644 (file)
@@ -1343,11 +1343,11 @@ public class Base64
             // the provided class loader.\r
             else {\r
                 ois = new java.io.ObjectInputStream(bais){\r
-                    @SuppressWarnings("unchecked")\r
                                        @Override\r
                     public Class<?> resolveClass(java.io.ObjectStreamClass streamClass)\r
                     throws java.io.IOException, ClassNotFoundException {\r
-                        Class c = Class.forName(streamClass.getName(), false, loader);\r
+                        @SuppressWarnings("rawtypes")\r
+                                               Class c = Class.forName(streamClass.getName(), false, loader);\r
                         if( c == null ){\r
                             return super.resolveClass(streamClass);\r
                         } else {\r
index 2c36707..effdcb6 100644 (file)
@@ -24,11 +24,14 @@ import java.util.HashMap;
 import java.util.List;\r
 \r
 import com.evernote.edam.type.Data;\r
+import com.evernote.edam.type.LinkedNotebook;\r
 import com.evernote.edam.type.Note;\r
 import com.evernote.edam.type.NoteAttributes;\r
 import com.evernote.edam.type.Notebook;\r
+import com.evernote.edam.type.Publishing;\r
 import com.evernote.edam.type.Resource;\r
 import com.evernote.edam.type.SavedSearch;\r
+import com.evernote.edam.type.SharedNotebook;\r
 import com.evernote.edam.type.Tag;\r
 import com.trolltech.qt.core.QByteArray;\r
 import com.trolltech.qt.core.QFile;\r
@@ -48,6 +51,8 @@ public class ExportData {
        private final ApplicationLogger                         logger;\r
        \r
        private List<SavedSearch>                                       searches;\r
+       private List<LinkedNotebook>                            linkedNotebooks;\r
+       private List<SharedNotebook>                            sharedNotebooks;\r
        private final HashMap<String,String>            dirtySearches;\r
 \r
        private List<Tag>                                                       tags;\r
@@ -57,7 +62,9 @@ public class ExportData {
        private final HashMap<String, String>           exportableTags;\r
        private List<Note>                                                      notes;\r
        private final HashMap<String,String>            dirtyNotes;\r
-       private HashMap<String,Integer>         titleColors;\r
+       private final HashMap<String,String>            dirtyLinkedNotebooks;\r
+       private final HashMap<Long,String>                      dirtySharedNotebooks;\r
+       private HashMap<String,Integer>                         titleColors;\r
        private final boolean                                           fullBackup;\r
        private final DatabaseConnection                        conn;\r
        private QXmlStreamWriter                                        writer;         \r
@@ -71,8 +78,12 @@ public class ExportData {
                notebooks = new ArrayList<Notebook>();\r
                tags = new ArrayList<Tag>();\r
                notes = new ArrayList<Note>();\r
+               sharedNotebooks = new ArrayList<SharedNotebook>();\r
+               linkedNotebooks = new ArrayList<LinkedNotebook>();\r
                dirtyNotebooks = new HashMap<String,String>();\r
                localNotebooks = new HashMap<String,String>();\r
+               dirtyLinkedNotebooks = new HashMap<String,String>();\r
+               dirtySharedNotebooks = new HashMap<Long,String>();\r
                dirtyTags = new HashMap<String,String>();\r
                fullBackup = full;\r
                \r
@@ -100,6 +111,8 @@ public class ExportData {
                fullBackup = full;\r
                \r
                dirtyNotes = new HashMap<String, String>();\r
+               dirtyLinkedNotebooks = new HashMap<String,String>();\r
+               dirtySharedNotebooks = new HashMap<Long,String>();\r
                dirtySearches = new HashMap<String, String>();\r
                searches = new ArrayList<SavedSearch>();\r
                \r
@@ -148,7 +161,17 @@ public class ExportData {
                dirtySearches.put(ds.get(i).getGuid(), "");\r
        }\r
                \r
-               \r
+       linkedNotebooks = conn.getLinkedNotebookTable().getAll();\r
+       List<String> dln = conn.getLinkedNotebookTable().getDirtyGuids();\r
+       for (int i=0; i<dln.size(); i++) {\r
+               dirtyLinkedNotebooks.put(dln.get(i), "");\r
+       }\r
+       \r
+       sharedNotebooks = conn.getSharedNotebookTable().getAll();\r
+       List<Long> dsn = conn.getSharedNotebookTable().getDirtyIds();\r
+       for (int i=0; i<dsn.size(); i++) {\r
+               dirtySharedNotebooks.put(dsn.get(i), "");\r
+       }\r
                \r
                lastError = 0;\r
                errorMessage = "";\r
@@ -164,7 +187,7 @@ public class ExportData {
                writer.writeStartDocument();\r
                writer.writeDTD("<!DOCTYPE NeverNote-Export>");\r
                writer.writeStartElement("nevernote-export");\r
-               writer.writeAttribute("version", "0.86");\r
+               writer.writeAttribute("version", "0.95");\r
                if (fullBackup)\r
                        writer.writeAttribute("exportType", "backup");\r
                else\r
@@ -191,6 +214,8 @@ public class ExportData {
                writeNotebooks();\r
                writeTags();\r
                writeSavedSearches();\r
+               writeLinkedNotebooks();\r
+               writeSharedNotebooks();\r
 \r
                \r
                writer.writeEndElement();\r
@@ -224,8 +249,51 @@ public class ExportData {
                }\r
        }\r
        \r
+       \r
+       private void writeLinkedNotebooks() {\r
+               if (!fullBackup)\r
+                       return;\r
+               for (int i=0; i<linkedNotebooks.size(); i++) {\r
+                       writer.writeStartElement("LinkedNotebook");\r
+                       createTextNode("Guid", linkedNotebooks.get(i).getGuid());\r
+                       createTextNode("ShardID", linkedNotebooks.get(i).getShardId());\r
+                       createTextNode("ShareKey", linkedNotebooks.get(i).getShareKey());\r
+                       createTextNode("ShareName", linkedNotebooks.get(i).getShareName());\r
+                       createTextNode("Uri", linkedNotebooks.get(i).getUri());\r
+                       createTextNode("Username", linkedNotebooks.get(i).getUsername());\r
+                       createTextNode("UpdateSequenceNumber", new Long(linkedNotebooks.get(i).getUpdateSequenceNum()).toString());\r
+                       if (dirtyLinkedNotebooks.containsKey(linkedNotebooks.get(i).getGuid()))\r
+                               createTextNode("Dirty", "true");\r
+                       else\r
+                               createTextNode("Dirty", "false");\r
+                       writer.writeEndElement();\r
+               }\r
+       }\r
+\r
                \r
        \r
+       private void writeSharedNotebooks() {\r
+               if (!fullBackup)\r
+                       return;\r
+               for (int i=0; i<linkedNotebooks.size(); i++) {\r
+                       writer.writeStartElement("SharedNotebook");\r
+                       createTextNode("Id", new Long(sharedNotebooks.get(i).getId()).toString());\r
+                       createTextNode("Userid", new Integer(sharedNotebooks.get(i).getUserId()).toString());\r
+                       createTextNode("Email", sharedNotebooks.get(i).getEmail());\r
+                       createTextNode("NotebookGuid", sharedNotebooks.get(i).getNotebookGuid());\r
+                       createTextNode("ShareKey", sharedNotebooks.get(i).getShareKey());\r
+                       createTextNode("Username", sharedNotebooks.get(i).getUsername());\r
+                       createTextNode("ServiceCreated", new Long(sharedNotebooks.get(i).getServiceCreated()).toString());\r
+                       if (dirtySharedNotebooks.containsKey(sharedNotebooks.get(i).getId()))\r
+                               createTextNode("Dirty", "true");\r
+                       else\r
+                               createTextNode("Dirty", "false");\r
+                       writer.writeEndElement();\r
+               }\r
+       }\r
+\r
+\r
+       \r
        private void writeNote(Note note) {\r
                \r
                writer.writeStartElement("Note");\r
@@ -392,6 +460,25 @@ public class ExportData {
                                        createTextNode("Dirty","true");\r
                                else\r
                                        createTextNode("Dirty","false");\r
+                               if (conn.getNotebookTable().isReadOnly(notebooks.get(i).getGuid()))\r
+                                       createTextNode("ReadOnly", "true");\r
+                               else\r
+                                       createTextNode("ReadOnly", "false");\r
+                               if (notebooks.get(i).getPublishing() != null) {\r
+                                       Publishing p = notebooks.get(i).getPublishing();\r
+                                       createTextNode("PublishingPublicDescription", p.getPublicDescription());\r
+                                       createTextNode("PublishingUri", p.getUri());\r
+                                       createTextNode("PublishingOrder", new Integer(p.getOrder().getValue()).toString());\r
+                                       if (p.isAscending())\r
+                                               createTextNode("PublishingAscending", "true");\r
+                                       else\r
+                                               createTextNode("PublishingAscending", "false");\r
+                               }\r
+                               QByteArray b = conn.getNotebookTable().getIconAsByteArray(notebooks.get(i).getGuid());\r
+                               if (b != null) \r
+                                       createBinaryNode("Icon", b.toHex().toString());\r
+                               if (notebooks.get(i).getStack() != null && !notebooks.get(i).getStack().trim().equals(""))\r
+                                       createTextNode("Stack", notebooks.get(i).getStack());\r
                                writer.writeEndElement();       \r
                        }\r
                }\r
index 47e8aa6..30f9a38 100644 (file)
@@ -25,16 +25,23 @@ import java.util.List;
 import java.util.Random;\r
 \r
 import com.evernote.edam.type.Data;\r
+import com.evernote.edam.type.LinkedNotebook;\r
 import com.evernote.edam.type.Note;\r
 import com.evernote.edam.type.NoteAttributes;\r
+import com.evernote.edam.type.NoteSortOrder;\r
 import com.evernote.edam.type.Notebook;\r
+import com.evernote.edam.type.Publishing;\r
 import com.evernote.edam.type.Resource;\r
 import com.evernote.edam.type.ResourceAttributes;\r
 import com.evernote.edam.type.SavedSearch;\r
+import com.evernote.edam.type.SharedNotebook;\r
 import com.evernote.edam.type.Tag;\r
 import com.trolltech.qt.core.QByteArray;\r
 import com.trolltech.qt.core.QFile;\r
 import com.trolltech.qt.core.QIODevice;\r
+import com.trolltech.qt.gui.QIcon;\r
+import com.trolltech.qt.gui.QImage;\r
+import com.trolltech.qt.gui.QPixmap;\r
 import com.trolltech.qt.xml.QXmlStreamAttributes;\r
 import com.trolltech.qt.xml.QXmlStreamReader;\r
 \r
@@ -53,6 +60,8 @@ public class ImportData {
        private Notebook                                        notebook;\r
        private boolean                                         notebookIsDirty;\r
        private boolean                                         notebookIsLocal;\r
+       private boolean                                         notebookIsReadOnly;\r
+       private QIcon                                           notebookIcon;\r
        private Tag                                                     tag;\r
        private boolean                                         tagIsDirty;\r
        private final HashMap<String,Integer>           titleColors;\r
@@ -63,19 +72,19 @@ public class ImportData {
        private final ApplicationLogger         logger;\r
        private final boolean                           backup;\r
        private String                                          notebookGuid;\r
+       private boolean                                         linkedNotebookIsDirty;\r
+       private boolean                                         sharedNotebookIsDirty;\r
+       private LinkedNotebook                          linkedNotebook;\r
+       private SharedNotebook                          sharedNotebook;\r
        public final boolean                            importTags = false;\r
        public final boolean                            importNotebooks = false;\r
-       private final HashMap<String,String>            tagMap;\r
        private final HashMap<String,String>            noteMap;\r
-       private final HashMap<String,String>            notebookMap;\r
        \r
        public ImportData(DatabaseConnection c, boolean full) {\r
                logger = new ApplicationLogger("import.log");\r
                backup = full;\r
                conn = c;\r
                titleColors = new HashMap<String,Integer>();\r
-               notebookMap = new HashMap<String,String>();\r
-               tagMap = new HashMap<String,String>();\r
                noteMap = new HashMap<String,String>();\r
        }\r
        \r
@@ -105,7 +114,8 @@ public class ImportData {
                                String version = attributes.value("version");\r
                                String type = attributes.value("exportType");\r
                                String application = attributes.value("application");\r
-                               if (!version.equalsIgnoreCase("0.85") && !version.equalsIgnoreCase("0.86")) {\r
+                               if (!version.equalsIgnoreCase("0.85") && !version.equalsIgnoreCase("0.86")\r
+                                               && !version.equalsIgnoreCase("0.95")) {\r
                                        lastError = 1;\r
                                        errorMessage = "Unknown backup version = " +version;\r
                                        return;\r
@@ -153,14 +163,14 @@ public class ImportData {
                        if (reader.name().equalsIgnoreCase("notebook") && reader.isStartElement() && (backup || importNotebooks)) {\r
                                processNotebookNode();\r
                        String existingGuid = conn.getNotebookTable().findNotebookByName(notebook.getName());\r
-                       if (existingGuid == null)\r
+                       if (existingGuid == null) {\r
                                conn.getNotebookTable().addNotebook(notebook, notebookIsDirty, notebookIsLocal);\r
-                       else \r
-                       {\r
+                       } else {\r
                                conn.getNotebookTable().updateNotebookGuid(existingGuid, notebook.getGuid());\r
                                conn.getNotebookTable().updateNotebook(notebook, notebookIsDirty);\r
                        }\r
-\r
+                       conn.getNotebookTable().setIcon(notebook.getGuid(), notebookIcon, "PNG");\r
+                       conn.getNotebookTable().setReadOnly(notebook.getGuid(), notebookIsReadOnly);\r
                        }\r
                        if (reader.name().equalsIgnoreCase("tag") && reader.isStartElement() && (backup || importTags)) {\r
                                processTagNode();\r
@@ -176,6 +186,14 @@ public class ImportData {
                                processSavedSearchNode();\r
                        conn.getSavedSearchTable().addSavedSearch(search, searchIsDirty);\r
                        }\r
+                       if (reader.name().equalsIgnoreCase("LinkedNotebook") && reader.isStartElement() && backup) {\r
+                               processLinkedNotebookNode();\r
+                       conn.getLinkedNotebookTable().addNotebook(linkedNotebook, linkedNotebookIsDirty);\r
+                       }\r
+                       if (reader.name().equalsIgnoreCase("SharedNotebook") && reader.isStartElement() && backup) {\r
+                               processSharedNotebookNode();\r
+                       conn.getSharedNotebookTable().addNotebook(sharedNotebook, sharedNotebookIsDirty);\r
+                       }\r
                }\r
                xmlFile.close();\r
        }\r
@@ -452,13 +470,84 @@ public class ImportData {
                                atEnd = true;           }       \r
                return;\r
        }\r
+       \r
+       \r
+       private void processLinkedNotebookNode() {\r
+               linkedNotebook = new LinkedNotebook();\r
+               linkedNotebookIsDirty = false;\r
+               \r
+               boolean atEnd = false;\r
+               while(!atEnd) {\r
+                       if (reader.isStartElement()) {\r
+                               if (reader.name().equalsIgnoreCase("Guid")) \r
+                                       linkedNotebook.setGuid(textValue());\r
+                               if (reader.name().equalsIgnoreCase("ShardID")) \r
+                                       linkedNotebook.setShardId(textValue());\r
+                               if (reader.name().equalsIgnoreCase("UpdateSequenceNumber")) \r
+                                       linkedNotebook.setUpdateSequenceNum(intValue());\r
+                               if (reader.name().equalsIgnoreCase("ShareKey")) \r
+                                       linkedNotebook.setShareKey(textValue());\r
+                               if (reader.name().equalsIgnoreCase("ShareName")) \r
+                                       linkedNotebook.setShareName(textValue());\r
+                               if (reader.name().equalsIgnoreCase("Uri")) \r
+                                       linkedNotebook.setUri(textValue());\r
+                               if (reader.name().equalsIgnoreCase("Username")) \r
+                                       linkedNotebook.setUsername(textValue());\r
+                               if (reader.name().equalsIgnoreCase("Dirty")) {\r
+                                       if (booleanValue())\r
+                                               linkedNotebookIsDirty = true;\r
+                               }\r
+                       }\r
+                       reader.readNext();\r
+                       if (reader.name().equalsIgnoreCase("LinkedNotebook") && reader.isEndElement())\r
+                               atEnd = true;           }       \r
+               return;\r
+       }\r
+\r
+\r
+       private void processSharedNotebookNode() {\r
+               sharedNotebook = new SharedNotebook();\r
+               sharedNotebookIsDirty = false;\r
+               \r
+               boolean atEnd = false;\r
+               while(!atEnd) {\r
+                       if (reader.isStartElement()) {\r
+                               if (reader.name().equalsIgnoreCase("Id")) \r
+                                       sharedNotebook.setId(intValue());\r
+                               if (reader.name().equalsIgnoreCase("Userid")) \r
+                                       sharedNotebook.setUserId(intValue());\r
+                               if (reader.name().equalsIgnoreCase("Email")) \r
+                                       sharedNotebook.setEmail(textValue());\r
+                               if (reader.name().equalsIgnoreCase("NotebookGuid")) \r
+                                       sharedNotebook.setNotebookGuid(textValue());\r
+                               if (reader.name().equalsIgnoreCase("ShareKey")) \r
+                                       sharedNotebook.setShareKey(textValue());\r
+                               if (reader.name().equalsIgnoreCase("Username")) \r
+                                       sharedNotebook.setUsername(textValue());\r
+                               if (reader.name().equalsIgnoreCase("ServiceCreated")) \r
+                                       sharedNotebook.setServiceCreated(longValue());\r
+                               if (reader.name().equalsIgnoreCase("Dirty")) {\r
+                                       if (booleanValue())\r
+                                               sharedNotebookIsDirty = true;\r
+                               }\r
+                       }\r
+                       reader.readNext();\r
+                       if (reader.name().equalsIgnoreCase("LinkedNotebook") && reader.isEndElement())\r
+                               atEnd = true;           }       \r
+               return;\r
+       }\r
 \r
+       \r
 \r
        \r
        private void processNotebookNode() {\r
                notebook = new Notebook();\r
+               Publishing p = new Publishing();\r
+               notebook.setPublishing(p);\r
                notebookIsDirty = false;\r
                notebookIsLocal = false;\r
+               notebookIsReadOnly = false;\r
+               notebookIcon = null;\r
                boolean atEnd = false;\r
                while(!atEnd) {\r
                        if (reader.isStartElement()) {\r
@@ -482,7 +571,38 @@ public class ImportData {
                                if (reader.name().equalsIgnoreCase("LocalNotebook")) {\r
                                        if (booleanValue())\r
                                                notebookIsLocal = true;\r
-                               }       \r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("ReadOnly")) {\r
+                                       if (booleanValue())\r
+                                               notebookIsReadOnly = true;\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("PublishingPublicDescription")) {\r
+                                       notebook.getPublishing().setPublicDescription(textValue());\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("PublishingUri")) {\r
+                                       notebook.getPublishing().setUri(textValue());\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("PublishingOrder")) {\r
+                                       notebook.getPublishing().setOrder(NoteSortOrder.findByValue(intValue()));\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("ReadOnly")) {\r
+                                       if (booleanValue())\r
+                                               notebookIsReadOnly = true;\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("PublishingAscending")) {\r
+                                       if (booleanValue())\r
+                                               notebook.getPublishing().setAscending(true);\r
+                                       else\r
+                                               notebook.getPublishing().setAscending(false);\r
+                               }               \r
+                               if (reader.name().equalsIgnoreCase("Icon")) {\r
+                                       byte[] b = textValue().getBytes();   // data binary\r
+                                       QByteArray hexData = new QByteArray(b);\r
+                                       QByteArray binData = new QByteArray(QByteArray.fromHex(hexData));\r
+                                       notebookIcon = new QIcon(QPixmap.fromImage(QImage.fromData(binData)));\r
+                               }\r
+                               if (reader.name().equalsIgnoreCase("Stack"))\r
+                                       notebook.setStack(textValue());\r
                        }\r
                        reader.readNext();\r
                        if (reader.name().equalsIgnoreCase("notebook") && reader.isEndElement())\r