ctlPrefWindow // Append trailing slash to the path read by ComDlg32.

- Already patched in the incoming Dictionary pane of the PrefUI.
This commit is contained in:
ShikiSuen 2022-04-09 14:56:53 +08:00
parent 9b85039069
commit e1c934d272
1 changed files with 6 additions and 4 deletions

View File

@ -266,10 +266,12 @@ import Cocoa
IME.dlgOpenPath.beginSheetModal(for: self.window!) { result in IME.dlgOpenPath.beginSheetModal(for: self.window!) { result in
if result == NSApplication.ModalResponse.OK { if result == NSApplication.ModalResponse.OK {
if IME.dlgOpenPath.url != nil { if IME.dlgOpenPath.url != nil {
if mgrLangModel.checkIfSpecifiedUserDataFolderValid( // CommonDialog
IME.dlgOpenPath.url!.path) //
{ var newPath = IME.dlgOpenPath.url!.path
mgrPrefs.userDataFolderSpecified = IME.dlgOpenPath.url!.path newPath.ensureTrailingSlash()
if mgrLangModel.checkIfSpecifiedUserDataFolderValid(newPath) {
mgrPrefs.userDataFolderSpecified = newPath
IME.initLangModels(userOnly: true) IME.initLangModels(userOnly: true)
} else { } else {
clsSFX.beep() clsSFX.beep()