1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +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; deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode - (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
contextInfo: (NSDictionary *) dict; contextInfo: (NSDictionary *) dict;
- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
fromRPC: (BOOL) rpc;
- (void) removeNoDelete: (id) sender; - (void) removeNoDelete: (id) sender;
- (void) removeDeleteData: (id) sender; - (void) removeDeleteData: (id) sender;
- (void) removeDeleteTorrent: (id) sender; - (void) removeDeleteTorrent: (id) sender;

View file

@ -140,9 +140,10 @@ typedef enum
#define FORUM_URL @"http://forum.transmissionbt.com/" #define FORUM_URL @"http://forum.transmissionbt.com/"
#define DONATE_URL @"http://www.transmissionbt.com/donate.php" #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]; [(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) 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 - (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"]; NSArray * torrents = [dict objectForKey: @"Torrents"];
if (returnCode == NSAlertDefaultReturn) if (returnCode == NSAlertDefaultReturn)
[self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue] [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]
deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue] fromRPC: NO]; deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue]];
else else
[torrents release]; [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 - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
fromRPC: (BOOL) rpc
{ {
//don't want any of these starting then stopping //don't want any of these starting then stopping
NSEnumerator * enumerator = [torrents objectEnumerator]; 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]); lowestOrderValue = MIN(lowestOrderValue, [torrent orderValue]);
if (rpc) [torrent closeRemoveTorrent];
[torrent closeRemoveTorrentInterface];
else
[torrent closeRemoveTorrent];
} }
[torrents release]; [torrents release];
@ -4287,7 +4284,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
- (void) rpcRemoveTorrent: (Torrent *) torrent - (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]; [torrent release];
} }

View file

@ -81,7 +81,6 @@ typedef enum
- (NSDictionary *) history; - (NSDictionary *) history;
- (void) closeRemoveTorrentInterface;
- (void) closeRemoveTorrent; - (void) closeRemoveTorrent;
- (void) changeIncompleteDownloadFolder: (NSString *) folder; - (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]]; return [@"Torrent: " stringByAppendingString: [self name]];
} }
- (void) closeRemoveTorrentInterface - (void) closeRemoveTorrent
{ {
//allow the file to be index by Time Machine //allow the file to be index by Time Machine
[self setTimeMachineExclude: NO forPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]]; [self setTimeMachineExclude: NO forPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
}
- (void) closeRemoveTorrent
{
[self closeRemoveTorrentInterface];
tr_torrentRemove(fHandle); tr_torrentRemove(fHandle);
} }