Fix issue #253 and add documentation

This commit is contained in:
Mark Jerde 2022-01-15 06:35:48 -06:00
parent acb100268d
commit c41711599e

View file

@ -687,6 +687,7 @@
}
-(IBAction)toggleLoadOnStartup:(id)sender {
// Since the control in Interface Builder is bound to User Defaults and sends this action, this method is called after User Defaults already reflects the newly-selected state and merely conveys that value to the relevant mechanisms rather than acting to negate the User Defaults state.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"loadOnStartup"] ) {
#ifdef SANDBOXING
SMLoginItemSetEnabled((__bridge CFStringRef)kFlycutHelperId, YES);
@ -695,7 +696,7 @@
#endif
} else {
#ifdef SANDBOXING
SMLoginItemSetEnabled((__bridge CFStringRef)kFlycutHelperId, YES);
SMLoginItemSetEnabled((__bridge CFStringRef)kFlycutHelperId, NO);
#else
[UKLoginItemRegistry removeLoginItemWithPath:[[NSBundle mainBundle] bundlePath]];
#endif