File tree 2 files changed +6
-11
lines changed
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
#import < Cocoa/Cocoa.h>
2
- #import " SRCommon.h" // for KeyCombo
2
+ #import " SRCommon.h" // for KeyCombo, also this imports <Carbon/Carbon.h>
3
3
4
4
extern NSString * const SSYShortcutActuatorDidNonemptyNotification ;
5
5
extern NSString * const SSYShortcutActuatorDidEmptyNotification ;
Original file line number Diff line number Diff line change @@ -483,6 +483,11 @@ + (SSYShortcutActuator*)sharedActuator {
483
483
484
484
- (KeyCombo)keyComboForSelectorName : (NSString *)selectorName {
485
485
KeyCombo keyCombo ;
486
+ // Fixed in BookMacster 1.18.0 so garbage values are not returned if
487
+ // shortcutInfos (below) comes up nil from user defaults.
488
+ keyCombo.code = -1 ;
489
+ keyCombo.flags = 0 ;
490
+
486
491
NSUserDefaults * sud = [NSUserDefaults standardUserDefaults ] ;
487
492
// Use -respondsToSelector: since one should never trust anything
488
493
// that comes out of user defaults
@@ -496,21 +501,11 @@ - (KeyCombo)keyComboForSelectorName:(NSString*)selectorName {
496
501
if ([number respondsToSelector: @selector (integerValue )]) {
497
502
keyCombo.code = [number integerValue ] ;
498
503
}
499
- else {
500
- keyCombo.code = -1 ;
501
- }
502
504
503
505
number = [shortcutInfo objectForKey: constKeyModifierFlags] ;
504
506
if ([number respondsToSelector: @selector (unsignedIntegerValue )]) {
505
507
keyCombo.flags = [number unsignedIntegerValue ] ;
506
508
}
507
- else {
508
- keyCombo.flags = 0 ;
509
- }
510
- }
511
- else {
512
- keyCombo.code = -1 ;
513
- keyCombo.flags = 0 ;
514
509
}
515
510
}
516
511
You can’t perform that action at this time.
0 commit comments