diff --git a/macosx/Controller.m b/macosx/Controller.m index 150d9e189..11346c811 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1121,34 +1121,35 @@ static void sleepCallBack(void * controller, io_service_t y, { #warning expand upon if ([torrent progress] >= 1.0) - { [torrent startTransfer]; - return; + else + { + if (![torrent waitingToStart]) + return; + + NSString * startSetting = [fDefaults stringForKey: @"StartSetting"]; + if ([startSetting isEqualToString: @"Wait"]) + { + int desiredActive = [fDefaults integerForKey: @"WaitToStartNumber"]; + + Torrent * tempTorrent; + NSEnumerator * enumerator = [fTorrents objectEnumerator]; + while ((tempTorrent = [enumerator nextObject])) + if ([tempTorrent isActive] && ![tempTorrent isSeeding]) + { + desiredActive--; + if (desiredActive <= 0) + return; + } + + [torrent startTransfer]; + } + else if ([startSetting isEqualToString: @"Start"]) + [torrent startTransfer]; + else; } - - if (![torrent waitingToStart]) - return; - NSString * startSetting = [fDefaults stringForKey: @"StartSetting"]; - if ([startSetting isEqualToString: @"Wait"]) - { - int desiredActive = [fDefaults integerForKey: @"WaitToStartNumber"]; - - Torrent * tempTorrent; - NSEnumerator * enumerator = [fTorrents objectEnumerator]; - while ((tempTorrent = [enumerator nextObject])) - if ([tempTorrent isActive] && ![tempTorrent isSeeding]) - { - desiredActive--; - if (desiredActive <= 0) - return; - } - - [torrent startTransfer]; - } - else if ([startSetting isEqualToString: @"Start"]) - [torrent startTransfer]; - else; + [torrent update]; } - (void) reloadInspector: (NSNotification *) notification diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index c7d6ace61..b260f7b50 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -298,8 +298,7 @@ } int limit = [sender intValue]; - if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] - || limit < 0) + if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] || limit < 0) { NSBeep(); limit = [fDefaults integerForKey: key]; @@ -395,8 +394,7 @@ NSString * key = sender == fSpeedLimitUploadField ? @"SpeedLimitUploadLimit" : @"SpeedLimitDownloadLimit"; int limit = [sender intValue]; - if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] - || limit < 0) + if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] || limit < 0) { NSBeep(); limit = [fDefaults integerForKey: key]; @@ -430,8 +428,8 @@ [fDefaults setFloat: ratioLimit forKey: @"RatioLimit"]; NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithBool: [fRatioCheck state]], @"Enable", - [NSNumber numberWithFloat: ratioLimit], @"Ratio", nil]; + [NSNumber numberWithBool: [fRatioCheck state]], @"Enable", + [NSNumber numberWithFloat: ratioLimit], @"Ratio", nil]; [[NSNotificationCenter defaultCenter] postNotificationName: @"RatioGlobalChange" object: dict]; }