From a14b535d223e7e8f2365c15e364ea6bad554d903 Mon Sep 17 00:00:00 2001 From: michael starke Date: Mon, 27 Oct 2014 21:42:05 +0100 Subject: [PATCH] Minor cleanup --- MacPass/MPAutotypeDaemon.m | 13 ------------- MacPass/MPIntegrationSettingsController.m | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/MacPass/MPAutotypeDaemon.m b/MacPass/MPAutotypeDaemon.m index d532e4c4..b9bd5412 100644 --- a/MacPass/MPAutotypeDaemon.m +++ b/MacPass/MPAutotypeDaemon.m @@ -27,11 +27,6 @@ NSString *const kMPWindowTitleKey = @"kMPWindowTitleKey"; NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey"; -/* - Enable to activate autotype - */ -#define MP_AUTOTYPE - @interface MPAutotypeDaemon () @property (nonatomic, assign) BOOL enabled; @@ -76,23 +71,17 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey"; - (void)setEnabled:(BOOL)enabled { if(_enabled != enabled) { _enabled = enabled; -#ifdef MP_AUTOTYPE self.enabled ? [self _registerHotKey] : [self _unregisterHotKey]; -#endif } } - (void)setHotKeyData:(NSData *)hotKeyData { if(![_hotKeyData isEqualToData:hotKeyData]) { -#ifdef MP_AUTOTYPE [self _unregisterHotKey]; -#endif _hotKeyData = [hotKeyData copy]; -#ifdef MP_AUTOTYPE if(self.enabled) { [self _registerHotKey]; } -#endif } } @@ -178,9 +167,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey"; NSArray *commands = [MPAutotypeCommand commandsForContext:context]; if([MPAutotypeDaemon _orderApplicationToFront:self.targetPID]) { /* Sleep a bit after the app was activated */ - NSLog(@"App wasn't frontmost, did order it there. Waiting a bit."); usleep(0.5 * NSEC_PER_MSEC); - NSLog(@"Done waiting."); } for(MPAutotypeCommand *command in commands) { [command execute]; diff --git a/MacPass/MPIntegrationSettingsController.m b/MacPass/MPIntegrationSettingsController.m index 9c0741ee..322cf485 100644 --- a/MacPass/MPIntegrationSettingsController.m +++ b/MacPass/MPIntegrationSettingsController.m @@ -49,7 +49,7 @@ [self.enableGlobalAutotypeCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil]; [self.enableQuicklookCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:quicklookKeyPath options:nil]; [self.hotKeyTextField bind:NSEnabledBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil]; - [self.hotKeyTextField bind:NSStringFromSelector(@selector(hotKey)) toObject:self withKeyPath:NSStringFromSelector(@selector(hotKey)) options:nil]; + self.hotKeyTextField.hotKey = self.hotKey; } - (void)setHotKey:(DDHotKey *)hotKey { @@ -65,5 +65,4 @@ _hotKey = hotKey; } - @end