diff --git a/macosx/Controller.m b/macosx/Controller.m index f9ba30012..7bbef6658 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -986,7 +986,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy } else { - [torrent closeRemoveTorrent]; + [torrent closeRemoveTorrent: NO]; [torrent release]; } } @@ -1054,7 +1054,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy } else { - [torrent closeRemoveTorrent]; + [torrent closeRemoveTorrent: NO]; [torrent release]; } } @@ -1457,10 +1457,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy //let's expand all groups that have removed items - they either don't exist anymore, are already expanded, or are collapsed (rpc) [fTableView removeCollapsedGroup: [torrent groupValue]]; - if (deleteData) - [torrent trashData]; - - [torrent closeRemoveTorrent]; + [torrent closeRemoveTorrent: deleteData]; } [torrents release]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 7d48d1c5f..05b8f0ceb 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -64,7 +64,7 @@ - (NSDictionary *) history; -- (void) closeRemoveTorrent; +- (void) closeRemoveTorrent: (BOOL) trashFiles; - (void) changeDownloadFolderBeforeUsing: (NSString *) folder; @@ -119,7 +119,6 @@ - (void) setPriority: (tr_priority_t) priority; + (void) trashFile: (NSString *) path; -- (void) trashData; - (void) moveTorrentDataFileTo: (NSString *) folder; - (void) copyTorrentFileTo: (NSString *) path; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 4d07e91c7..97b62fac1 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -227,7 +227,7 @@ int trashDataFile(const char * filename) return [self retain]; } -- (void) closeRemoveTorrent +- (void) closeRemoveTorrent: (BOOL) trashFiles { //allow the file to be indexed by Time Machine if (fTimeMachineExclude) @@ -237,7 +237,7 @@ int trashDataFile(const char * filename) fTimeMachineExclude = nil; } - tr_torrentRemove(fHandle); + tr_torrentRemove(fHandle, trashFiles, trashDataFile); } - (void) changeDownloadFolderBeforeUsing: (NSString *) folder @@ -503,11 +503,6 @@ int trashDataFile(const char * filename) } } -- (void) trashData -{ - tr_torrentDeleteLocalData(fHandle, trashDataFile); -} - - (void) moveTorrentDataFileTo: (NSString *) folder { NSString * oldFolder = [self currentDirectory];