mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 10:28:32 +00:00
#5005 Torrent file deleted twice when added via url
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
NSString * fDestination, * fTorrentFile;
|
NSString * fDestination, * fTorrentFile;
|
||||||
BOOL fLockDestination;
|
BOOL fLockDestination;
|
||||||
|
|
||||||
BOOL fDeleteTorrentInitial, fDeleteEnableInitial;
|
BOOL fDeleteTorrentEnableInitially, fCanToggleDelete;
|
||||||
NSInteger fGroupValue;
|
NSInteger fGroupValue;
|
||||||
|
|
||||||
NSTimer * fTimer;
|
NSTimer * fTimer;
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
|
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
|
||||||
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
|
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
|
||||||
deleteTorrent: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete;
|
deleteTorrentCheckEnableInitially: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete; //if canToggleDelete is NO, we will also not delete the file regardless of the delete check's state (this is so it can be disabled and checked for a downloaded torrent, where the file's already deleted)
|
||||||
|
|
||||||
- (Torrent *) torrent;
|
- (Torrent *) torrent;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
|
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
|
||||||
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
|
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
|
||||||
deleteTorrent: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete
|
deleteTorrentCheckEnableInitially: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete
|
||||||
{
|
{
|
||||||
if ((self = [super initWithWindowNibName: @"AddWindow"]))
|
if ((self = [super initWithWindowNibName: @"AddWindow"]))
|
||||||
{
|
{
|
||||||
@@ -67,8 +67,8 @@
|
|||||||
|
|
||||||
fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
|
fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
|
||||||
|
|
||||||
fDeleteTorrentInitial = deleteTorrent;
|
fDeleteTorrentEnableInitially = deleteTorrent;
|
||||||
fDeleteEnableInitial = canToggleDelete;
|
fCanToggleDelete = canToggleDelete;
|
||||||
|
|
||||||
fGroupValue = [torrent groupValue];
|
fGroupValue = [torrent groupValue];
|
||||||
|
|
||||||
@@ -122,8 +122,8 @@
|
|||||||
|
|
||||||
[fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState];
|
[fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState];
|
||||||
|
|
||||||
[fDeleteCheck setState: fDeleteTorrentInitial ? NSOnState : NSOffState];
|
[fDeleteCheck setState: fDeleteTorrentEnableInitially ? NSOnState : NSOffState];
|
||||||
[fDeleteCheck setEnabled: fDeleteEnableInitial];
|
[fDeleteCheck setEnabled: fCanToggleDelete];
|
||||||
|
|
||||||
if (fDestination)
|
if (fDestination)
|
||||||
[self setDestinationPath: fDestination];
|
[self setDestinationPath: fDestination];
|
||||||
@@ -334,7 +334,7 @@
|
|||||||
fTimer = nil;
|
fTimer = nil;
|
||||||
[fTorrent setGroupValue: fGroupValue];
|
[fTorrent setGroupValue: fGroupValue];
|
||||||
|
|
||||||
if (fTorrentFile && [fDeleteCheck state] == NSOnState)
|
if (fTorrentFile && fCanToggleDelete && [fDeleteCheck state] == NSOnState)
|
||||||
[Torrent trashFile: fTorrentFile];
|
[Torrent trashFile: fTorrentFile];
|
||||||
|
|
||||||
if ([fStartCheck state] == NSOnState)
|
if ([fStartCheck state] == NSOnState)
|
||||||
|
|||||||
@@ -926,7 +926,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||||||
{
|
{
|
||||||
AddWindowController * addController = [[AddWindowController alloc] initWithTorrent: torrent destination: location
|
AddWindowController * addController = [[AddWindowController alloc] initWithTorrent: torrent destination: location
|
||||||
lockDestination: lockDestination controller: self torrentFile: torrentPath
|
lockDestination: lockDestination controller: self torrentFile: torrentPath
|
||||||
deleteTorrent: deleteTorrentFile canToggleDelete: canToggleDelete];
|
deleteTorrentCheckEnableInitially: deleteTorrentFile canToggleDelete: canToggleDelete];
|
||||||
[addController showWindow: self];
|
[addController showWindow: self];
|
||||||
|
|
||||||
if (!fAddWindows)
|
if (!fAddWindows)
|
||||||
|
|||||||
Reference in New Issue
Block a user