(trunk) fix bug where downloads would not be added when dragging the url onto the window without a constant download location

This commit is contained in:
Mitchell Livingston 2007-08-13 03:17:18 +00:00
parent 8729aba95f
commit 1381610a56
3 changed files with 20 additions and 4 deletions

View File

@ -313,7 +313,7 @@
4DFBC2DD09C0970D00D5C571 /* Torrent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Torrent.h; path = macosx/Torrent.h; sourceTree = "<group>"; };
4DFBC2DE09C0970D00D5C571 /* Torrent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Torrent.m; path = macosx/Torrent.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = Info.plist; path = macosx/Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoWindowController.h; path = macosx/InfoWindowController.h; sourceTree = "<group>"; };
A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = "<group>"; };
A200B9630A227FD0007BBB1E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = macosx/English.lproj/InfoWindow.nib; sourceTree = "<group>"; };

View File

@ -96,8 +96,10 @@
IBOutlet NSMenu * fDockMenu;
NSMutableArray * fAutoImportedNames;
NSMutableDictionary * fPendingTorrentDownloads;
NSTimer * fAutoImportTimer;
NSMutableDictionary * fPendingTorrentDownloads;
NSMutableArray * fTempTorrentFiles;
BOOL fRemoteQuit;
}

View File

@ -198,6 +198,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[fAutoImportedNames release];
[fPendingTorrentDownloads release];
[fTempTorrentFiles release];
tr_close(fLib);
[super dealloc];
@ -541,6 +542,16 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[fPendingTorrentDownloads removeAllObjects];
}
//remove all torrent files in the temporary directory
if (fTempTorrentFiles)
{
NSEnumerator * torrentEnumerator = [fTempTorrentFiles objectEnumerator];
NSString * path;
while ((path = [torrentEnumerator nextObject]))
[[NSFileManager defaultManager] removeFileAtPath: path handler: nil];
[fTempTorrentFiles removeAllObjects];
}
//stop timers
[fTimer invalidate];
[fSpeedLimitTimer invalidate];
@ -653,8 +664,10 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
[download release];
//delete torrent file if it wasn't already
[[NSFileManager defaultManager] removeFileAtPath: path handler: nil];
//delete temp torrent file on quit
if (!fTempTorrentFiles)
fTempTorrentFiles = [[NSMutableArray alloc] init];
[fTempTorrentFiles addObject: path];
}
- (void) application: (NSApplication *) app openFiles: (NSArray *) filenames
@ -944,6 +957,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
}
#warning combine
- (void) openURLEndSheet: (id) sender
{
[fURLSheetWindow orderOut: sender];