if the download finishes/becomes unfinished, keep trying to reset the time machine setting, and other miscellaneous cleanup

This commit is contained in:
Mitchell Livingston 2007-11-02 22:07:16 +00:00
parent 7ce8312ddc
commit 1f0b346295
4 changed files with 5 additions and 7 deletions

View File

@ -29,7 +29,7 @@
{
tr_handle * fLib;
NSImage * fDockIcon, * fBadge, * fUploadBadge, * fDownloadBadge;
NSImage * fDockIcon, * fBadge, * fUploadBadge;
NSDictionary * fAttributes;
int fCompleted, fCompletedBadged;

View File

@ -173,11 +173,8 @@
stringRect.origin.y += spaceBetween;
}
if (!fDownloadBadge)
fDownloadBadge = [NSImage imageNamed: @"DownloadBadge"];
//place badge and text
[fDownloadBadge compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver];
[[NSImage imageNamed: @"DownloadBadge"] compositeToPoint: badgeRect.origin operation: NSCompositeSourceOver];
[self badgeString: downloadRateString forRect: stringRect];
}

View File

@ -592,6 +592,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
//wait for running transfers to stop and for NAT to be disabled (5 second timeout)
NSDate * startDate = [NSDate date];
#warning do this in tr_close?
while ([startDate timeIntervalSinceNow] >= -5.0 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED)
usleep(100000);

View File

@ -1631,7 +1631,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if ([NSApp isOnLeopardOrBetter])
{
NSURL *url = [NSURL fileURLWithPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
CSBackupSetItemExcluded((CFURLRef)url, false, false);
fNeedSetTimeMachine = CSBackupSetItemExcluded((CFURLRef)url, false, false) != noErr;
}
fStat = tr_torrentStat(fHandle);
@ -1643,7 +1643,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if ([NSApp isOnLeopardOrBetter])
{
NSURL *url = [NSURL fileURLWithPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
CSBackupSetItemExcluded((CFURLRef)url, true, false);
fNeedSetTimeMachine = CSBackupSetItemExcluded((CFURLRef)url, true, false) != noErr;
}
[[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentRestartedDownloading" object: self];