mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
cleaner way of moving torrent from incomplete folder
This commit is contained in:
parent
93bb89e3d3
commit
7b64e68386
1 changed files with 8 additions and 4 deletions
|
@ -224,6 +224,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
#warning make less confusing
|
||||
- (void) setDownloadFolder: (NSString *) path
|
||||
{
|
||||
if (path)
|
||||
|
@ -264,11 +265,15 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
if (fUseIncompleteFolder && ![[self downloadFolder] isEqualToString: fDownloadFolder]
|
||||
&& (canMove = [self alertForMoveFolderAvailable]))
|
||||
{
|
||||
tr_torrentStop(fHandle);
|
||||
//pause without actually stopping
|
||||
tr_setDownloadLimit(fHandle, 0);
|
||||
tr_setUploadLimit(fHandle, 0);
|
||||
|
||||
if ([[NSFileManager defaultManager] movePath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]
|
||||
toPath: [fDownloadFolder stringByAppendingPathComponent: [self name]] handler: nil])
|
||||
tr_torrentSetFolder(fHandle, [fDownloadFolder UTF8String]);
|
||||
tr_torrentStart(fHandle);
|
||||
|
||||
[self updateSpeedSetting];
|
||||
}
|
||||
|
||||
if (!canMove)
|
||||
|
@ -777,8 +782,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
else
|
||||
{
|
||||
[fDownloadFolder release];
|
||||
fDownloadFolder = folder;
|
||||
[self setDownloadFolder: fDownloadFolder];
|
||||
[self setDownloadFolder: folder];
|
||||
}
|
||||
|
||||
[self startTransfer];
|
||||
|
|
Loading…
Reference in a new issue