mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
#2009 Quarantine files when downloading finishes
This commit is contained in:
parent
244c3f1839
commit
8057b31936
1 changed files with 11 additions and 0 deletions
|
@ -1818,6 +1818,17 @@ int trashDataFile(const char * filename)
|
|||
//simpler to create a new dictionary than to use statusInfo - avoids retention chicanery
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self
|
||||
userInfo: [NSDictionary dictionaryWithObject: [statusInfo objectForKey: @"WasRunning"] forKey: @"WasRunning"]];
|
||||
|
||||
NSString * dataLocation = [[self currentDirectory] stringByAppendingPathComponent: [self name]];
|
||||
FSRef ref;
|
||||
if (FSPathMakeRef((const UInt8 *)[dataLocation UTF8String], &ref, NULL) == noErr)
|
||||
{
|
||||
NSDictionary * quarantineProperties = [NSDictionary dictionaryWithObject: (NSString *)kLSQuarantineTypeOtherDownload forKey: (NSString *)kLSQuarantineTypeKey];
|
||||
LSSetItemAttribute(&ref, kLSRolesAll, kLSItemQuarantineProperties, quarantineProperties);
|
||||
}
|
||||
else
|
||||
NSLog(@"Could not find file to quarantine: %@!", dataLocation);
|
||||
|
||||
break;
|
||||
|
||||
case TR_LEECH:
|
||||
|
|
Loading…
Reference in a new issue