OSDN Git Service

- Added the ability to do special refreshes for debugging. - Added the ability to...
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / Global.java
index 495db8d..b301e4a 100644 (file)
@@ -1703,10 +1703,53 @@ public class Global {
     }\r
     \r
     //*******************\r
-    // Index attachments\r
+    // Index settings\r
     //*******************\r
+    // Set/Get if we should index the text of a note\r
+    public static boolean indexNoteBody() {\r
+               settings.beginGroup("Index");\r
+               try {\r
+                       String value = (String)settings.value("indexNoteBody", "true");\r
+                       settings.endGroup();\r
+                       if (value.equals("true"))\r
+                               return true;\r
+                       else\r
+                               return false;\r
+               } catch (java.lang.ClassCastException e) {\r
+                       Boolean value = (Boolean) settings.value("indexNoteBody", true);\r
+                       settings.endGroup();\r
+                       return value;\r
+               }\r
+    }\r
+    public static void setIndexNoteTitle(boolean value) {\r
+               settings.beginGroup("Index");\r
+               settings.setValue("indexNoteTitle", value);\r
+               settings.endGroup();    \r
+    }\r
+    // Set/Get if we should index the title of a note\r
+    public static boolean indexNoteTitle() {\r
+               settings.beginGroup("Index");\r
+               try {\r
+                       String value = (String)settings.value("indexNoteTitle", "true");\r
+                       settings.endGroup();\r
+                       if (value.equals("true"))\r
+                               return true;\r
+                       else\r
+                               return false;\r
+               } catch (java.lang.ClassCastException e) {\r
+                       Boolean value = (Boolean) settings.value("indexNoteTitle", true);\r
+                       settings.endGroup();\r
+                       return value;\r
+               }\r
+    }\r
+    public static void setIndexNoteBody(boolean value) {\r
+               settings.beginGroup("Index");\r
+               settings.setValue("indexNoteBody", value);\r
+               settings.endGroup();    \r
+    }\r
+    // Set/Get if we should index any attachments\r
     public static boolean indexAttachmentsLocally() {\r
-               settings.beginGroup("Debug");\r
+               settings.beginGroup("Index");\r
                try {\r
                        String value = (String)settings.value("indexAttachmentsLocally", "true");\r
                        settings.endGroup();\r
@@ -1720,12 +1763,45 @@ public class Global {
                        return value;\r
                }\r
     }\r
+    public static void setIndexImageRecognition(boolean value) {\r
+               settings.beginGroup("Index");\r
+               settings.setValue("indexImageRecognition", value);\r
+               settings.endGroup();    \r
+    }\r
+    public static boolean indexImageRecognition() {\r
+               settings.beginGroup("Index");\r
+               try {\r
+                       String value = (String)settings.value("indexImageRecognition", "true");\r
+                       settings.endGroup();\r
+                       if (value.equals("true"))\r
+                               return true;\r
+                       else\r
+                               return false;\r
+               } catch (java.lang.ClassCastException e) {\r
+                       Boolean value = (Boolean) settings.value("indexImageRecognition", true);\r
+                       settings.endGroup();\r
+                       return value;\r
+               }\r
+    }\r
     public static void setIndexAttachmentsLocally(boolean value) {\r
-               settings.beginGroup("Debug");\r
+               settings.beginGroup("Index");\r
                settings.setValue("indexAttachmentsLocally", value);\r
                settings.endGroup();    \r
     }\r
-\r
+    // Get/Set characters that shouldn't be removed from a word\r
+    public static String getSpecialIndexCharacters() {\r
+               settings.beginGroup("Index");\r
+               String text = (String)settings.value("specialCharacters", "");\r
+               settings.endGroup();    \r
+               return text;\r
+    }\r
+    public static void setSpecialIndexCharacters(String value) {\r
+               settings.beginGroup("Index");\r
+               settings.setValue("specialCharacters", value);\r
+               settings.endGroup();    \r
+               databaseCache = value;\r
+    }\r
+    \r
     //*****************************************************************************\r
     // Control how tag selection behaves (should they be "and" or "or" selections\r
     //*****************************************************************************\r