(trunk) fix a problem when adding multiple torrents with "always ask" enabled

This commit is contained in:
Mitchell Livingston 2007-08-15 22:30:54 +00:00
parent 455ce8b185
commit 4bccdef1fd
2 changed files with 8 additions and 6 deletions

View File

@ -331,7 +331,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; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; 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

@ -817,7 +817,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
tr_info_t info;
while ([files count] > 0)
{
torrentPath = [files objectAtIndex: 0];
torrentPath = [[files objectAtIndex: 0] retain];
canAdd = tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info);
if (canAdd == TR_OK)
break;
@ -836,8 +836,9 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[self updateTorrentHistory];
return;
}
[files removeObjectAtIndex: 0];
NSOpenPanel * panel = [NSOpenPanel openPanel];
[panel setPrompt: NSLocalizedString(@"Select", "Open torrent -> prompt")];
@ -848,11 +849,12 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
"Open torrent -> select destination folder"), [NSString stringWithUTF8String: info.name]]];
NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: [torrentPath retain], @"Path",
files, @"Files", [NSNumber numberWithInt: deleteTorrent], @"DeleteTorrent", nil];
tr_metainfoFree(&info);
NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrentPath, @"Path",
files, @"Files", [NSNumber numberWithInt: deleteTorrent], @"DeleteTorrent", nil];
[torrentPath release];
[panel beginSheetForDirectory: nil file: nil types: nil modalForWindow: fWindow modalDelegate: self
didEndSelector: @selector(folderChoiceClosed:returnCode:contextInfo:) contextInfo: dictionary];
}