diff --git a/Source/Modules/AppDelegate.swift b/Source/Modules/AppDelegate.swift index d243e9d1..c6c3965a 100644 --- a/Source/Modules/AppDelegate.swift +++ b/Source/Modules/AppDelegate.swift @@ -47,7 +47,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega private var ctlAboutWindowInstance: ctlAboutWindow? // New About Window private var checkTask: URLSessionTask? private var updateNextStepURL: URL? - private var fsStreamHelper = FSEventStreamHelper( + public var fsStreamHelper = FSEventStreamHelper( path: mgrLangModel.dataFolderPath(isDefaultFolder: false), queue: DispatchQueue(label: "vChewing User Phrases") ) @@ -76,6 +76,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega } } + func updateStreamHelperPath() { + fsStreamHelper.path = mgrPrefs.userDataFolderSpecified + } + func showPreferences() { if ctlPrefWindowInstance == nil { ctlPrefWindowInstance = ctlPrefWindow.init(windowNibName: "frmPrefWindow") diff --git a/Source/Modules/FileHandlers/FSEventStreamHelper.swift b/Source/Modules/FileHandlers/FSEventStreamHelper.swift index 9cff0253..69e5eff5 100644 --- a/Source/Modules/FileHandlers/FSEventStreamHelper.swift +++ b/Source/Modules/FileHandlers/FSEventStreamHelper.swift @@ -37,7 +37,7 @@ public class FSEventStreamHelper: NSObject { var id: FSEventStreamEventId } - public let path: String + public var path: String public let dispatchQueue: DispatchQueue public weak var delegate: FSEventStreamHelperDelegate? diff --git a/Source/UI/PrefUI/suiPrefPaneDictionary.swift b/Source/UI/PrefUI/suiPrefPaneDictionary.swift index 4c3794d7..b1f7a635 100644 --- a/Source/UI/PrefUI/suiPrefPaneDictionary.swift +++ b/Source/UI/PrefUI/suiPrefPaneDictionary.swift @@ -79,6 +79,7 @@ struct suiPrefPaneDictionary: View { mgrPrefs.userDataFolderSpecified = newPath tbxUserDataPathSpecified = mgrPrefs.userDataFolderSpecified IME.initLangModels(userOnly: true) + (NSApplication.shared.delegate as! AppDelegate).updateStreamHelperPath() } else { clsSFX.beep() if !bolPreviousFolderValidity { diff --git a/Source/WindowControllers/ctlPrefWindow.swift b/Source/WindowControllers/ctlPrefWindow.swift index 81b87247..fc8812da 100644 --- a/Source/WindowControllers/ctlPrefWindow.swift +++ b/Source/WindowControllers/ctlPrefWindow.swift @@ -276,6 +276,7 @@ class ctlPrefWindow: NSWindowController { if mgrLangModel.checkIfSpecifiedUserDataFolderValid(newPath) { mgrPrefs.userDataFolderSpecified = newPath IME.initLangModels(userOnly: true) + (NSApplication.shared.delegate as! AppDelegate).updateStreamHelperPath() } else { clsSFX.beep() if !bolPreviousFolderValidity {