Revision: 4457
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4457&view=rev
Author:   hofman
Date:     2008-08-27 09:53:55 +0000 (Wed, 27 Aug 2008)

Log Message:
-----------
Only instantiate remote controller when there is one activated.

Modified Paths:
--------------
    trunk/SKApplicationController.m

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2008-08-26 22:18:46 UTC (rev 4456)
+++ trunk/SKApplicationController.m     2008-08-27 09:53:55 UTC (rev 4457)
@@ -167,23 +167,30 @@
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{
     [NSApp setServicesProvider:self];
     
+    NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
+    
     NSString *versionString = [[[NSBundle mainBundle] infoDictionary] 
objectForKey:(NSString *)kCFBundleVersionKey];
     SKVersionNumber *versionNumber = versionString ? [SKVersionNumber 
versionNumberWithVersionString:versionString] : nil;
-    NSString *lastVersionString = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKLastVersionLaunchedKey];
+    NSString *lastVersionString = [sud stringForKey:SKLastVersionLaunchedKey];
     SKVersionNumber *lastVersionNumber = lastVersionString ? [SKVersionNumber 
versionNumberWithVersionString:lastVersionString] : nil;
     if(lastVersionNumber == nil || [lastVersionNumber 
compareToVersionNumber:versionNumber] == NSOrderedAscending) {
         [self showReleaseNotes:nil];
-        [[NSUserDefaults standardUserDefaults] setObject:versionString 
forKey:SKLastVersionLaunchedKey];
+        [sud setObject:versionString forKey:SKLastVersionLaunchedKey];
     }
     
-    NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
-    RemoteControlContainer *container = [[RemoteControlContainer alloc] 
initWithDelegate:self];
-    if ([sud boolForKey:SKEnableAppleRemoteKey])
+    RemoteControlContainer *container = nil;
+    if ([sud boolForKey:SKEnableAppleRemoteKey]) {
+        if (container == nil) container = [[RemoteControlContainer alloc] 
initWithDelegate:self];
         [container instantiateAndAddRemoteControlDeviceWithClass:[AppleRemote 
class]]; 
-    if ([sud boolForKey:SKEnableKeyspanFrontRowControlKey])
+    }
+    if ([sud boolForKey:SKEnableKeyspanFrontRowControlKey]) {
+        if (remoteControl == nil) remoteControl = [[RemoteControlContainer 
alloc] initWithDelegate:self];
         [container 
instantiateAndAddRemoteControlDeviceWithClass:[KeyspanFrontRowControl class]];
-    if ([sud boolForKey:SKEnableKeyboardRemoteSimulationKey])
+    }
+    if ([sud boolForKey:SKEnableKeyboardRemoteSimulationKey]) {
+        if (container == nil) container = [[RemoteControlContainer alloc] 
initWithDelegate:self];
         [container 
instantiateAndAddRemoteControlDeviceWithClass:[GlobalKeyboardDevice class]];    
    
+    }
     remoteControl = container;
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to