diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.h b/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.h index 0a1cc8cca37..87d240701d9 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.h +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.h @@ -1,9 +1,6 @@ /* * Keyman is copyright (C) SIL International. MIT License. * - * KMDataRepository.h - * Keyman - * * Created by Shawn Schantz on 2024-07-30. * */ @@ -13,9 +10,12 @@ NS_ASSUME_NONNULL_BEGIN @interface KMDataRepository : NSObject -@property (readonly) NSURL *keymanDataDirectory; // '~/Library/Application Support/keyman.inputmethod.Keyman' +// keymanDataDirectory: '~/Library/Application Support/keyman.inputmethod.Keyman' +@property (readonly) NSURL *keymanDataDirectory; + +// keymanKeyboardsDirectory: '~/Library/Application Support/keyman.inputmethod.Keyman/Keyman-Keyboards' @property (readonly) NSURL *keymanKeyboardsDirectory; -// keymanKeyboardsDirectory = '~/Library/Application Support/keyman.inputmethod.Keyman/Keyman-Keyboards' + + (KMDataRepository *)shared; - (void)createDataDirectoryIfNecessary; - (void)createKeyboardsDirectoryIfNecessary; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.m b/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.m index 20d6e892a46..9ecedab2314 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.m +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMDataRepository.m @@ -1,9 +1,6 @@ /* * Keyman is copyright (C) SIL International. MIT License. * - * KMResourcesRepository.m - * Keyman - * * Created by Shawn Schantz on 2024-07-30. * * Singleton object which serves as an abstraction for the reading and writing of Keyman data. @@ -39,11 +36,11 @@ @implementation KMDataRepository @synthesize obsoleteKeymanKeyboardsDirectory = _obsoleteKeymanKeyboardsDirectory; NSString *const kKeyboardsDirectoryName = @"Keyman-Keyboards"; -/* - The name of the subdirectory within '~/Library/Application Support'. - We follow the convention of using the bundle identifier rather than our subsystem id. - (Also, using the subsystem id, "com.keyman.app", is a poor choice because the API - createDirectoryAtPath sees the .app extension and creates an application file. +/** + * The name of the subdirectory within '~/Library/Application Support'. + * We follow the convention of using the bundle identifier rather than our subsystem id. + * (Also, using the subsystem id, "com.keyman.app", is a poor choice because the API + * createDirectoryAtPath sees the .app extension and creates an application file.) */ NSString *const kKeymanSubdirectoryName = @"keyman.inputmethod.Keyman"; @@ -158,6 +155,7 @@ - (NSURL *)obsoleteKeymanKeyboardsDirectory { } return _obsoleteKeymanKeyboardsDirectory; } + /** * Only called from migrateData. * Causes user to be prompted for permission to access ~/Documents, but they should already have it. diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMSettingsRepository.m b/mac/Keyman4MacIM/Keyman4MacIM/KMSettingsRepository.m index a605ea6e6ec..630e2c324e5 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/KMSettingsRepository.m +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMSettingsRepository.m @@ -1,9 +1,6 @@ /* * Keyman is copyright (C) SIL International. MIT License. * - * KMSettingsRepository.h - * Keyman - * * Created by Shawn Schantz on 2024-07-29. * * Singleton object for reading and writing Keyman application settings. @@ -61,7 +58,7 @@ - (BOOL)settingsExist { * For versions before version 1, the keyboards were stored under the ~/Documents directory. */ - (BOOL)dataModelWithKeyboardsInLibrary { - // NSUserDefaults returns zero if the key does not exist + // [NSUserDefaults integerForKey] returns zero if the key does not exist NSInteger dataModelVersion = [[NSUserDefaults standardUserDefaults] integerForKey:kDataModelVersion]; return dataModelVersion >= kVersionStoreDataInLibraryDirectory; @@ -142,7 +139,6 @@ - (void)convertSelectedKeyboardPathForMigration { * Convert the path of the keyboard designating the Documents folder to its new location * in the Application Support folder */ - - (NSString *)convertOldKeyboardPath:(NSString *)oldPath { NSString *newPathString = @""; if(oldPath != nil) {