Changeset 11395


Ignore:
Timestamp:
Nov 8, 2010, 12:28:30 PM (11 years ago)
Author:
livings124
Message:

experimental fix to Time Machine exclusion list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r11348 r11395  
    4040        waitToStart: (NSNumber *) waitToStart
    4141        groupValue: (NSNumber *) groupValue
    42         downloadFolder: (NSString *) downloadFolder legacyIncompleteFolder: (NSString *) incompleteFolder;
     42        timeMachineExcludeLocation: (NSString *) timeMachineExclude
     43        downloadFolder: (NSString *) downloadFolder
     44        legacyIncompleteFolder: (NSString *) incompleteFolder;
    4345
    4446- (void) createFileList;
     
    9597    self = [self initWithPath: path hash: nil torrentStruct: NULL magnetAddress: nil lib: lib
    9698            waitToStart: nil groupValue: nil
    97             downloadFolder: location legacyIncompleteFolder: nil];
     99            timeMachineExcludeLocation: nil
     100            downloadFolder: location
     101            legacyIncompleteFolder: nil];
    98102   
    99103    if (self)
     
    109113    self = [self initWithPath: nil hash: nil torrentStruct: torrentStruct magnetAddress: nil lib: lib
    110114            waitToStart: nil groupValue: nil
    111             downloadFolder: location legacyIncompleteFolder: nil];
     115            timeMachineExcludeLocation: nil
     116            downloadFolder: location
     117            legacyIncompleteFolder: nil];
    112118   
    113119    return self;
     
    118124    self = [self initWithPath: nil hash: nil torrentStruct: nil magnetAddress: address
    119125            lib: lib waitToStart: nil groupValue: nil
     126            timeMachineExcludeLocation: nil
    120127            downloadFolder: location legacyIncompleteFolder: nil];
    121128   
     
    132139                waitToStart: [history objectForKey: @"WaitToStart"]
    133140                groupValue: [history objectForKey: @"GroupValue"]
     141                timeMachineExcludeLocation: [history objectForKey: @"TimeMachineExcludeLocation"]
    134142                downloadFolder: [history objectForKey: @"DownloadFolder"] //upgrading from versions < 1.80
    135143                legacyIncompleteFolder: [[history objectForKey: @"UseIncompleteFolder"] boolValue] //upgrading from versions < 1.80
     
    175183- (NSDictionary *) history
    176184{
    177     return [NSDictionary dictionaryWithObjectsAndKeys:
    178                 [self torrentLocation], @"InternalTorrentPath",
    179                 [self hashString], @"TorrentHash",
    180                 [NSNumber numberWithBool: [self isActive]], @"Active",
    181                 [NSNumber numberWithBool: fWaitToStart], @"WaitToStart",
    182                 [NSNumber numberWithInt: fGroupValue], @"GroupValue", nil];
     185    NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     186                                        [self torrentLocation], @"InternalTorrentPath",
     187                                        [self hashString], @"TorrentHash",
     188                                        [NSNumber numberWithBool: [self isActive]], @"Active",
     189                                        [NSNumber numberWithBool: fWaitToStart], @"WaitToStart",
     190                                        [NSNumber numberWithInt: fGroupValue], @"GroupValue", nil];
     191   
     192    if (fTimeMachineExclude)
     193        [history setObject: fTimeMachineExclude forKey: @"TimeMachineExcludeLocation"];
     194   
     195    return history;
    183196}
    184197
     
    217230- (void) closeRemoveTorrent
    218231{
    219     //allow the file to be index by Time Machine
     232    //allow the file to be indexed by Time Machine
    220233    if (fTimeMachineExclude)
    221234    {
     
    15911604        waitToStart: (NSNumber *) waitToStart
    15921605        groupValue: (NSNumber *) groupValue
    1593         downloadFolder: (NSString *) downloadFolder legacyIncompleteFolder: (NSString *) incompleteFolder
     1606        timeMachineExcludeLocation: (NSString *) timeMachineExclude
     1607        downloadFolder: (NSString *) downloadFolder
     1608        legacyIncompleteFolder: (NSString *) incompleteFolder
    15941609{
    15951610    if (!(self = [super init]))
     
    16551670        name: @"GroupValueRemoved" object: nil];
    16561671   
    1657     fTimeMachineExclude = nil;
     1672    fTimeMachineExclude = [timeMachineExclude retain];
    16581673    [self update];
    16591674   
Note: See TracChangeset for help on using the changeset viewer.