From 1241f4136652ac9629457a83953d8f8bf3889bdd Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Mon, 24 May 2004 13:05:15 +0000 Subject: [PATCH] Fixed some warnings. Upped the server check to 90 seconds, from 45. --- MainController.m | 30 +++++++----------------------- MenuTunes.xcode/project.pbxproj | 2 +- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/MainController.m b/MainController.m index 8079f3b..c2acaf1 100755 --- a/MainController.m +++ b/MainController.m @@ -33,6 +33,7 @@ @interface MainController(Private) - (ITMTRemote *)loadRemote; - (void)setLatestSongIdentifier:(NSString *)newIdentifier; +- (void)checkForRemoteServer; - (void)applicationLaunched:(NSNotification *)note; - (void)applicationTerminated:(NSNotification *)note; @end @@ -89,10 +90,7 @@ static MainController *sharedController; if ([df boolForKey:@"enableSharing"]) { [self setServerStatus:YES]; } else if ([df boolForKey:@"useSharedPlayer"]) { - [self checkForRemoteServer:nil]; - /*if ([self connectToServer] == 0) { - [NSTimer scheduledTimerWithTimeInterval:45 target:self selector:@selector(checkForRemoteServer:) userInfo:nil repeats:YES]; - }*/ + [self checkForRemoteServer]; } //Setup for notification of the remote player launching or quitting @@ -165,7 +163,7 @@ static MainController *sharedController; Class remoteClass = [remoteBundle principalClass]; if ([remoteClass conformsToProtocol:@protocol(ITMTRemote)] && - [remoteClass isKindOfClass:[NSObject class]]) { + [(NSObject *)remoteClass isKindOfClass:[NSObject class]]) { id remote = [remoteClass remote]; ITDebugLog(@"Adding remote at path %@", bundlePath); [remoteArray addObject:remote]; @@ -1135,24 +1133,10 @@ static MainController *sharedController; return YES; } -- (void)checkForRemoteServer:(NSTimer *)timer +- (void)checkForRemoteServer { ITDebugLog(@"Checking for remote server."); - - //New code [NSThread detachNewThreadSelector:@selector(runRemoteServerCheck:) toTarget:self withObject:nil]; - //[timer invalidate]; - // - - /*if ([networkController checkForServerAtHost:[df stringForKey:@"sharedPlayerHost"]]) { - ITDebugLog(@"Remote server found."); - [timer invalidate]; - if (![networkController isServerOn] && ![networkController isConnectedToServer]) { - [[StatusWindowController sharedController] showReconnectQueryWindow]; - } - } else { - ITDebugLog(@"Remote server not found."); - }*/ } - (void)runRemoteServerCheck:(id)sender @@ -1178,7 +1162,7 @@ static MainController *sharedController; - (void)remoteServerNotFound:(id)sender { - [NSTimer scheduledTimerWithTimeInterval:45 target:self selector:@selector(checkForRemoteServer:) userInfo:nil repeats:NO]; + [NSTimer scheduledTimerWithTimeInterval:90.0 target:self selector:@selector(checkForRemoteServer) userInfo:nil repeats:NO]; } - (void)networkError:(NSException *)exception @@ -1188,7 +1172,7 @@ static MainController *sharedController; NSRunCriticalAlertPanel(@"Remote MenuTunes Disconnected", @"The MenuTunes server you were connected to stopped responding or quit. MenuTunes will revert back to the local player.", @"OK", nil, nil); if ([self disconnectFromServer]) { [[PreferencesController sharedPrefs] resetRemotePlayerTextFields]; - [NSTimer scheduledTimerWithTimeInterval:45 target:self selector:@selector(checkForRemoteServer:) userInfo:nil repeats:YES]; + [NSTimer scheduledTimerWithTimeInterval:90.0 target:self selector:@selector(checkForRemoteServer) userInfo:nil repeats:YES]; } else { ITDebugLog(@"CRITICAL ERROR, DISCONNECTING!"); } @@ -1198,7 +1182,7 @@ static MainController *sharedController; - (void)reconnect { if ([self connectToServer] == 0) { - [NSTimer scheduledTimerWithTimeInterval:45 target:self selector:@selector(checkForRemoteServer:) userInfo:nil repeats:YES]; + [NSTimer scheduledTimerWithTimeInterval:90.0 target:self selector:@selector(checkForRemoteServer) userInfo:nil repeats:YES]; } [[StatusWindow sharedWindow] setLocked:NO]; [[StatusWindow sharedWindow] vanish:self]; diff --git a/MenuTunes.xcode/project.pbxproj b/MenuTunes.xcode/project.pbxproj index bfe6a22..58ed113 100755 --- a/MenuTunes.xcode/project.pbxproj +++ b/MenuTunes.xcode/project.pbxproj @@ -1527,7 +1527,7 @@ LIBRARY_SEARCH_PATHS = .; MACOSX_DEPLOYMENT_TARGET = 10.2; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-bind_at_load"; PRODUCT_NAME = MenuTunes; SECTORDER_FLAGS = ""; WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; -- 2.20.1