mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Make sure we also delete the temp dir when the user clicks "cancel" during the download.
This commit is contained in:
1 parent
1b02ab5f7f
commit
fa8aaced55
1 file changed
+6
-1
@@ -118,11 +118,16 @@
|
||||
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [self _humanReadableSizeFromDouble:[statusController progressValue]]]];
|
||||
}
|
||||
|
||||
- (IBAction)cancelDownload:sender
|
||||
- (IBAction)cancelDownload: (id)sender
|
||||
{
|
||||
if (download)
|
||||
[download cancel];
|
||||
[self abortUpdate];
|
||||
if (tempDir != nil) // tempDir contains downloadPath, so we implicitly delete both here.
|
||||
{
|
||||
if( ![[NSFileManager defaultManager] removeFileAtPath: tempDir handler: nil] )
|
||||
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tempDir stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tempDir lastPathComponent]] tag:NULL];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
|
||||
Reference in new issue
Block a user