1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +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)
- OS X:
+ Leopard: Time Machine will ignore incomplete files
+ Leopard: Fix bug with typing values in Inspector->Options
+ 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];
}
#warning need?
- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (int) row
{
return nil;

View file

@ -1475,6 +1475,14 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[self createFileList];
[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;
}
@ -1609,11 +1617,25 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[fDateCompleted release];
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);
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self];
break;
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];
break;
}