1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

trunk: Leopard: Time Machine will ignore incomplete files

This commit is contained in:
Mitchell Livingston 2007-10-31 19:28:22 +00:00
parent e625b10d6d
commit 93caebd82f
3 changed files with 23 additions and 1 deletions

1
NEWS
View file

@ -2,6 +2,7 @@ NEWS file for Transmission <http://transmission.m0k.org/>
0.92 (2007/xx/yy) 0.92 (2007/xx/yy)
- OS X: - OS X:
+ Leopard: Time Machine will ignore incomplete files
+ Leopard: Fix bug with typing values in Inspector->Options + Leopard: Fix bug with typing values in Inspector->Options
+ Leopard: Fix bug with toggling Minimal View + Leopard: Fix bug with toggling Minimal View

View file

@ -2253,7 +2253,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
return [fDisplayedTorrents count]; return [fDisplayedTorrents count];
} }
#warning need?
- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (int) row - (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (int) row
{ {
return nil; return nil;

View file

@ -1475,6 +1475,14 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[self createFileList]; [self createFileList];
[self update]; [self update];
//mark incomplete files to be ignored by Time Machine
if ([NSApp isOnLeopardOrBetter])
{
NSURL *url = [NSURL fileURLWithPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
CSBackupSetItemExcluded((CFURLRef)url, ![self allDownloaded], false);
}
return self; return self;
} }
@ -1609,11 +1617,25 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[fDateCompleted release]; [fDateCompleted release];
fDateCompleted = [[NSDate alloc] init]; fDateCompleted = [[NSDate alloc] init];
//allow to be backed up by Time Machine
if ([NSApp isOnLeopardOrBetter])
{
NSURL *url = [NSURL fileURLWithPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
CSBackupSetItemExcluded((CFURLRef)url, false, false);
}
fStat = tr_torrentStat(fHandle); fStat = tr_torrentStat(fHandle);
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self];
break; break;
case TR_CP_INCOMPLETE: case TR_CP_INCOMPLETE:
//do not allow to be backed up by Time Machine
if ([NSApp isOnLeopardOrBetter])
{
NSURL *url = [NSURL fileURLWithPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
CSBackupSetItemExcluded((CFURLRef)url, true, false);
}
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentRestartedDownloading" object: self]; [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentRestartedDownloading" object: self];
break; break;
} }