Changeset 9348


Ignore:
Timestamp:
Oct 21, 2009, 10:20:43 PM (12 years ago)
Author:
livings124
Message:

update the time machine exclude list when the file is moved through rpc

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r9312 r9348  
    266266- (void) rpcStartedStoppedTorrent: (Torrent *) torrent;
    267267- (void) rpcChangedTorrent: (Torrent *) torrent;
     268- (void) rpcMovedTorrent: (Torrent *) torrent;
    268269
    269270@end
  • trunk/macosx/Controller.m

    r9347 r9348  
    42504250            break;
    42514251       
     4252        case TR_RPC_TORRENT_MOVED:
     4253            [self performSelectorOnMainThread: @selector(rpcMovedTorrent:) withObject: torrent waitUntilDone: NO];
     4254            break;
     4255       
    42524256        case TR_RPC_SESSION_CHANGED:
    42534257            [fPrefsController performSelectorOnMainThread: @selector(rpcUpdatePrefs) withObject: nil waitUntilDone: NO];
     
    43094313}
    43104314
     4315- (void) rpcMovedTorrent: (Torrent *) torrent
     4316{
     4317    [torrent update];
     4318    [torrent updateTimeMachineExclude];
     4319   
     4320    if ([[fTableView selectedTorrents] containsObject: torrent])
     4321        [fInfoController updateInfoStats];
     4322   
     4323    [torrent release];
     4324}
     4325
    43114326@end
  • trunk/macosx/Torrent.h

    r9342 r9348  
    223223- (BOOL) isStalled;
    224224
     225- (void) updateTimeMachineExclude;
     226
    225227- (NSInteger) stateSortKey;
    226228- (NSString *) trackerSortKey;
  • trunk/macosx/Torrent.m

    r9343 r9348  
    4747- (NSString *) etaString;
    4848
    49 - (void) updateTimeMachineExclude;
    5049- (void) setTimeMachineExclude: (BOOL) exclude forPath: (NSString *) path;
    5150
     
    14561455{
    14571456    return fStalled;
     1457}
     1458
     1459- (void) updateTimeMachineExclude
     1460{
     1461    NSString * newLocation = [self dataLocation];
     1462   
     1463    if (fTimeMachineExclude && newLocation && [fTimeMachineExclude isEqualToString: newLocation] && ![self allDownloaded])
     1464        return;
     1465   
     1466    if (fTimeMachineExclude)
     1467    {
     1468        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
     1469        [fTimeMachineExclude release];
     1470        fTimeMachineExclude = nil;
     1471    }
     1472   
     1473    if (newLocation && ![self allDownloaded])
     1474    {
     1475        [self setTimeMachineExclude: YES forPath: newLocation];
     1476        [fTimeMachineExclude release];
     1477        fTimeMachineExclude = [newLocation retain];
     1478    }
    14581479}
    14591480
     
    17351756}
    17361757
    1737 - (void) updateTimeMachineExclude
    1738 {
    1739     NSString * newLocation = [self dataLocation];
    1740    
    1741     if (fTimeMachineExclude && newLocation && [fTimeMachineExclude isEqualToString: newLocation] && ![self allDownloaded])
    1742         return;
    1743    
    1744     if (fTimeMachineExclude)
    1745     {
    1746         [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
    1747         [fTimeMachineExclude release];
    1748         fTimeMachineExclude = nil;
    1749     }
    1750    
    1751     if (newLocation && ![self allDownloaded])
    1752     {
    1753         [self setTimeMachineExclude: YES forPath: newLocation];
    1754         [fTimeMachineExclude release];
    1755         fTimeMachineExclude = [newLocation retain];
    1756     }
    1757 }
    1758 
    17591758- (void) setTimeMachineExclude: (BOOL) exclude forPath: (NSString *) path
    17601759{
Note: See TracChangeset for help on using the changeset viewer.