Changeset 492


Ignore:
Timestamp:
Jul 1, 2006, 12:44:22 AM (16 years ago)
Author:
livings124
Message:

Remove a variable.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.h

    r490 r492  
    5656
    5757    NSString                * fDownloadFolder;
    58     BOOL                    fSpeedLimit;
    5958    NSUserDefaults          * fDefaults;
    6059}
  • trunk/macosx/PrefsController.m

    r490 r492  
    132132   
    133133    //set speed limit
    134     fSpeedLimit = [fDefaults boolForKey: @"SpeedLimit"];
    135    
    136134    int speedLimitUploadLimit = [fDefaults integerForKey: @"SpeedLimitUploadLimit"];
    137135    [fSpeedLimitUploadField setIntValue: speedLimitUploadLimit];
     
    141139   
    142140    //actually set bandwidth limits
    143     if (fSpeedLimit)
     141    if ([fDefaults boolForKey: @"SpeedLimit"])
    144142    {
    145143        tr_setUploadLimit(fHandle, speedLimitUploadLimit);
     
    310308    else
    311309    {
    312         if (!fSpeedLimit)
     310        if (![fDefaults boolForKey: @"SpeedLimit"])
    313311        {
    314312            if (sender == fUploadField)
     
    376374- (void) enableSpeedLimit: (BOOL) enable
    377375{
    378     if (fSpeedLimit != enable)
    379     {
    380         fSpeedLimit = enable;
    381         [fDefaults setBool: fSpeedLimit forKey: @"SpeedLimit"];
     376    if ([fDefaults boolForKey: @"SpeedLimit"] != enable)
     377    {
     378        [fDefaults setBool: enable forKey: @"SpeedLimit"];
    382379       
    383         if (fSpeedLimit)
     380        if (enable)
    384381        {
    385382            tr_setUploadLimit(fHandle, [fDefaults integerForKey: @"SpeedLimitUploadLimit"]);
     
    396393- (void) setSpeedLimit: (id) sender
    397394{
    398     NSString * key;
    399     if (sender == fSpeedLimitUploadField)
    400         key = @"SpeedLimitUploadLimit";
    401     else
    402         key = @"SpeedLimitDownloadLimit";
     395    NSString * key = sender == fSpeedLimitUploadField ? @"SpeedLimitUploadLimit" : @"SpeedLimitDownloadLimit";
    403396
    404397    int limit = [sender intValue];
     
    412405    else
    413406    {
    414         if (fSpeedLimit)
     407        if ([fDefaults boolForKey: @"SpeedLimit"])
    415408        {
    416409            if (sender == fSpeedLimitUploadField)
Note: See TracChangeset for help on using the changeset viewer.