mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +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];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning make less confusing
|
||||||
- (void) setDownloadFolder: (NSString *) path
|
- (void) setDownloadFolder: (NSString *) path
|
||||||
{
|
{
|
||||||
if (path)
|
if (path)
|
||||||
|
@ -264,11 +265,15 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
if (fUseIncompleteFolder && ![[self downloadFolder] isEqualToString: fDownloadFolder]
|
if (fUseIncompleteFolder && ![[self downloadFolder] isEqualToString: fDownloadFolder]
|
||||||
&& (canMove = [self alertForMoveFolderAvailable]))
|
&& (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]]
|
if ([[NSFileManager defaultManager] movePath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]
|
||||||
toPath: [fDownloadFolder stringByAppendingPathComponent: [self name]] handler: nil])
|
toPath: [fDownloadFolder stringByAppendingPathComponent: [self name]] handler: nil])
|
||||||
tr_torrentSetFolder(fHandle, [fDownloadFolder UTF8String]);
|
tr_torrentSetFolder(fHandle, [fDownloadFolder UTF8String]);
|
||||||
tr_torrentStart(fHandle);
|
|
||||||
|
[self updateSpeedSetting];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canMove)
|
if (!canMove)
|
||||||
|
@ -777,8 +782,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[fDownloadFolder release];
|
[fDownloadFolder release];
|
||||||
fDownloadFolder = folder;
|
[self setDownloadFolder: folder];
|
||||||
[self setDownloadFolder: fDownloadFolder];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self startTransfer];
|
[self startTransfer];
|
||||||
|
|
Loading…
Reference in a new issue