Changeset 3413


Ignore:
Timestamp:
Oct 14, 2007, 10:29:20 PM (14 years ago)
Author:
livings124
Message:

store a torrent's queue order as an NSNumber instead of an int to avoid excessively recreating the object

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r3412 r3413  
    6666    BOOL    fFinishedSeeding, fWaitToStart, fError, fChecking, fStalled;
    6767   
    68     int fOrderValue;
     68    NSNumber * fOrderValue;
    6969   
    7070    NSDictionary * fQuickPauseDict;
     
    199199
    200200- (BOOL) pex;
    201 - (void) setPex: (BOOL) enabled;
     201- (void) setPex: (BOOL) enable;
    202202
    203203- (NSNumber *) orderValue;
  • trunk/macosx/Torrent.m

    r3412 r3413  
    167167   
    168168    [fFileList release];
    169    
    170169    [fFileMenu release];
     170   
     171    [fOrderValue release];
    171172   
    172173    [fQuickPauseDict release];
     
    11351136}
    11361137
    1137 - (void) setPex: (BOOL) enabled
    1138 {
    1139         tr_torrentDisablePex(fHandle, !enabled);
     1138- (void) setPex: (BOOL) enable
     1139{
     1140        tr_torrentDisablePex(fHandle, !enable);
    11401141}
    11411142
    11421143- (NSNumber *) orderValue
    11431144{
    1144     return [NSNumber numberWithInt: fOrderValue];
     1145    return fOrderValue;
    11451146}
    11461147
    11471148- (void) setOrderValue: (int) orderValue
    11481149{
    1149     fOrderValue = orderValue;
     1150    [fOrderValue release];
     1151    fOrderValue = [[NSNumber alloc] initWithInt: orderValue];
    11501152}
    11511153
     
    14711473   
    14721474    fWaitToStart = waitToStart ? [waitToStart boolValue] : [fDefaults boolForKey: @"AutoStartDownload"];
    1473     fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
     1475   
     1476    [self setOrderValue: orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1];
    14741477    fError = NO;
    14751478   
Note: See TracChangeset for help on using the changeset viewer.