OSDN Git Service

Merge branch 'japaneseSearch' into develop
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / dialog / ConfigDialog.java
index d313565..aae31c4 100644 (file)
@@ -44,6 +44,8 @@ import com.trolltech.qt.gui.QVBoxLayout;
 \r
 import cx.fbn.nevernote.Global;\r
 import cx.fbn.nevernote.NeverNote;\r
+import cx.fbn.nevernote.sql.DatabaseConnection;\r
+import cx.fbn.nevernote.sql.driver.NSqlQuery;\r
 public class ConfigDialog extends QDialog {\r
        private final QListWidget                               contentsWidget;\r
        private final ConfigFontPage                    fontPage;\r
@@ -55,11 +57,13 @@ public class ConfigDialog extends QDialog {
        private final ConfigIndexPage                   indexPage;\r
        private final ConfigRensoNoteListPage   rensoNoteListPage;\r
        private final NeverNote                                 parent;\r
+       private final DatabaseConnection conn;\r
        \r
-    private final String iconPath = new String("classpath:cx/fbn/nevernote/icons/");\r
-       \r
-       public ConfigDialog(NeverNote parent) {\r
+       private final String iconPath = new String("classpath:cx/fbn/nevernote/icons/");\r
+    \r
+       public ConfigDialog(NeverNote parent, DatabaseConnection conn) {\r
                this.parent = parent;\r
+               this.conn = conn;\r
                \r
                contentsWidget = new QListWidget(this);\r
                setWindowIcon(new QIcon(iconPath+"config.png"));\r
@@ -176,13 +180,13 @@ public class ConfigDialog extends QDialog {
                Global.setIndexNoteBody(indexPage.getIndexNoteBody());\r
                Global.setIndexNoteTitle(indexPage.getIndexNoteTitle());\r
                Global.setIndexImageRecognition(indexPage.getIndexImageRecognition());\r
-               Global.setAutomaticWildcardSearches(indexPage.getAutomaticWildcardSearches());\r
-               Global.setSpecialIndexCharacters(indexPage.getSpecialCharacters());\r
+//             Global.setAutomaticWildcardSearches(indexPage.getAutomaticWildcardSearches());\r
+//             Global.setSpecialIndexCharacters(indexPage.getSpecialCharacters());\r
                Global.setIncludeTagChildren(appearancePage.getIncludeTagChildren());\r
                Global.setDisplayRightToLeft(appearancePage.getDisplayRightToLeft());\r
                \r
                Global.userStoreUrl = "https://"+debugPage.getServer()+"/edam/user";\r
-               Global.setWordRegex(indexPage.getRegex());\r
+//             Global.setWordRegex(indexPage.getRegex());\r
                Global.setRecognitionWeight(indexPage.getRecognitionWeight());\r
                Global.setIndexThreadSleepInterval(indexPage.getSleepInterval());\r
                Global.setMessageLevel( debugPage.getDebugLevel());\r
@@ -229,8 +233,8 @@ public class ConfigDialog extends QDialog {
                Global.setBrowseWeight(rensoNoteListPage.getBrowseWeight());\r
                Global.setCopyPasteWeight(rensoNoteListPage.getCopyPasteWeight());\r
                Global.setAddNewNoteWeight(rensoNoteListPage.getAddNewNoteWeight());\r
-               Global.setRensoItemClickWeight(rensoNoteListPage.getRensoItemClickWeight());
-               Global.setSameTagWeight(rensoNoteListPage.getSameTagWeight());
+               Global.setRensoItemClickWeight(rensoNoteListPage.getRensoItemClickWeight());\r
+               Global.setSameTagWeight(rensoNoteListPage.getSameTagWeight());\r
                Global.setSameNotebookWeight(rensoNoteListPage.getSameNotebookWeight());\r
                Global.setENRelatedNotesWeight(rensoNoteListPage.getENRelatedNotesWeight());\r
                \r
@@ -243,6 +247,16 @@ public class ConfigDialog extends QDialog {
                // 連想ノートリストをリフレッシュ\r
                parent.getRensoNoteList().refreshRensoNoteList(parent.getCurrentNoteGuid());\r
                \r
+               // 全文検索の対象項目を再設定\r
+               NSqlQuery nQuery = new NSqlQuery(conn.getConnection());\r
+               NSqlQuery rQuery = new NSqlQuery(conn.getResourceConnection()); \r
+               // カラム単位で削除できないので一度全部消す\r
+               nQuery.exec("CALL FTL_DROP_ALL();");\r
+               rQuery.exec("CALL FTL_DROP_ALL();");\r
+               // 再構築\r
+               Global.rebuildFullTextNoteTarget(conn);\r
+               Global.rebuildFullTextResourceTarget(conn);\r
+               \r
                close();\r
        }\r
        \r
@@ -351,7 +365,7 @@ public class ConfigDialog extends QDialog {
                appearancePage.setDisplayRightToLeft(Global.displayRightToLeft());\r
                appearancePage.setStartupNotebook(Global.getStartupNotebook());\r
                \r
-               indexPage.setRegex(Global.getWordRegex());\r
+//             indexPage.setRegex(Global.getWordRegex());\r
                indexPage.setSleepInterval(Global.getIndexThreadSleepInterval());\r
                connectionPage.setSyncInterval(Global.getSyncInterval());\r
                \r