Ignore:
Timestamp:
Mar 31, 2007, 1:00:51 AM (15 years ago)
Author:
livings124
Message:

store date completed internally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r1609 r1611  
    3535- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
    3636        publicTorrent: (NSNumber *) publicTorrent
    37         dateAdded: (NSDate *) dateAdded
     37        dateAdded: (NSDate *) dateAdded dateCompleted: (NSDate *) dateCompleted
    3838        ratioSetting: (NSNumber *) ratioSetting ratioLimit: (NSNumber *) ratioLimit
    3939        limitSpeedCustom: (NSNumber *) limitCustom
     
    6969    self = [self initWithHash: nil path: path lib: lib
    7070            publicTorrent: delete ? [NSNumber numberWithBool: NO] : nil
    71             dateAdded: nil
     71            dateAdded: nil dateCompleted: nil
    7272            ratioSetting: nil ratioLimit: nil
    7373            limitSpeedCustom: nil
     
    9393                publicTorrent: [history objectForKey: @"PublicCopy"]
    9494                dateAdded: [history objectForKey: @"Date"]
     95                                dateCompleted: [history objectForKey: @"DateCompleted"]
    9596                ratioSetting: [history objectForKey: @"RatioSetting"]
    9697                ratioLimit: [history objectForKey: @"RatioLimit"]
     
    170171    if (fPublicTorrent)
    171172        [history setObject: [self publicTorrentLocation] forKey: @"TorrentPath"];
    172    
     173       
     174        if (fDateCompleted)
     175                [history setObject: [self dateAdded] forKey: @"DateCompleted"];
     176       
    173177    return history;
    174178}
     
    191195       
    192196        [fDateAdded release];
     197                if (fDateCompleted)
     198                        [fDateCompleted release];
    193199       
    194200        if (fAnnounceDate)
     
    268274            fIncompleteFolder = nil;
    269275        }
     276               
     277                if (fDateCompleted)
     278                        [fDateCompleted release];
     279                fDateCompleted = [[NSDate alloc] init];
    270280       
    271281        fStat = tr_torrentStat(fHandle);
     
    11861196}
    11871197
     1198- (NSDate *) dateCompleted
     1199{
     1200    return fDateCompleted;
     1201}
     1202
    11881203- (NSNumber *) stateSortKey
    11891204{
     
    12171232- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
    12181233        publicTorrent: (NSNumber *) publicTorrent
    1219         dateAdded: (NSDate *) dateAdded
     1234        dateAdded: (NSDate *) dateAdded dateCompleted: (NSDate *) dateCompleted
    12201235        ratioSetting: (NSNumber *) ratioSetting ratioLimit: (NSNumber *) ratioLimit
    12211236        limitSpeedCustom: (NSNumber *) limitCustom
     
    12541269
    12551270    fDateAdded = dateAdded ? [dateAdded retain] : [[NSDate alloc] init];
    1256    
     1271        if (dateCompleted)
     1272                fDateCompleted = [dateCompleted retain];
     1273       
    12571274    fRatioSetting = ratioSetting ? [ratioSetting intValue] : NSMixedState;
    12581275    fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];
Note: See TracChangeset for help on using the changeset viewer.