1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

always manually remove torrents from libT, even when removed through rpc

This commit is contained in:
Mitchell Livingston 2008-08-14 02:18:14 +00:00
parent f4a5315ec4
commit 12a10f514f
4 changed files with 8 additions and 18 deletions

View file

@ -151,8 +151,7 @@ typedef enum
deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
contextInfo: (NSDictionary *) dict;
- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
fromRPC: (BOOL) rpc;
- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
- (void) removeNoDelete: (id) sender;
- (void) removeDeleteData: (id) sender;
- (void) removeDeleteTorrent: (id) sender;

View file

@ -140,9 +140,10 @@ typedef enum
#define FORUM_URL @"http://forum.transmissionbt.com/"
#define DONATE_URL @"http://www.transmissionbt.com/donate.php"
static void rpcCallback(tr_handle * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct, void * controller)
static tr_rpc_callback_status rpcCallback(tr_handle * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct, void * controller)
{
[(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
return TR_RPC_NOREMOVE; //we'll do the remove manually
}
static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
@ -1217,7 +1218,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
}
}
[self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent fromRPC: NO];
[self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
}
- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (NSDictionary *) dict
@ -1225,7 +1226,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
NSArray * torrents = [dict objectForKey: @"Torrents"];
if (returnCode == NSAlertDefaultReturn)
[self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]
deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue] fromRPC: NO];
deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue]];
else
[torrents release];
@ -1233,7 +1234,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
}
- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
fromRPC: (BOOL) rpc
{
//don't want any of these starting then stopping
NSEnumerator * enumerator = [torrents objectEnumerator];
@ -1257,10 +1257,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
lowestOrderValue = MIN(lowestOrderValue, [torrent orderValue]);
if (rpc)
[torrent closeRemoveTorrentInterface];
else
[torrent closeRemoveTorrent];
[torrent closeRemoveTorrent];
}
[torrents release];
@ -4287,7 +4284,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
- (void) rpcRemoveTorrent: (Torrent *) torrent
{
[self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO deleteTorrent: NO fromRPC: YES];
[self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO deleteTorrent: NO];
[torrent release];
}

View file

@ -81,7 +81,6 @@ typedef enum
- (NSDictionary *) history;
- (void) closeRemoveTorrentInterface;
- (void) closeRemoveTorrent;
- (void) changeIncompleteDownloadFolder: (NSString *) folder;

View file

@ -191,15 +191,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
return [@"Torrent: " stringByAppendingString: [self name]];
}
- (void) closeRemoveTorrentInterface
- (void) closeRemoveTorrent
{
//allow the file to be index by Time Machine
[self setTimeMachineExclude: NO forPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
}
- (void) closeRemoveTorrent
{
[self closeRemoveTorrentInterface];
tr_torrentRemove(fHandle);
}