Changeset 2218
- Timestamp:
- Jun 28, 2007, 1:36:30 AM (15 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r2211 r2218 775 775 int canAdd; 776 776 tr_info_t info; 777 do 778 { 779 if ([files count] == 0) //no files left to open 780 { 781 [files release]; 782 783 [self updateTorrentHistory]; 784 return; 785 } 786 787 torrentPath = [[files objectAtIndex: 0] retain]; 777 while ([files count] > 0) 778 { 779 torrentPath = [files objectAtIndex: 0]; 780 if (tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info) == TR_OK) 781 break; 782 783 tr_metainfoFree(&info); 788 784 [files removeObjectAtIndex: 0]; 789 } while (tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info) != TR_OK); 785 } 786 787 //no files left to open 788 if ([files count] <= 0) 789 { 790 [files release]; 791 [self updateTorrentHistory]; 792 return; 793 } 790 794 791 795 NSOpenPanel * panel = [NSOpenPanel openPanel]; … … 801 805 [panel setMessage: @"Select the download folder "]; 802 806 803 NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrentPath, @"Path",807 NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: [torrentPath retain], @"Path", 804 808 files, @"Files", [NSNumber numberWithBool: delete], @"Delete", nil]; 805 [torrentPath release];809 tr_metainfoFree(&info); 806 810 807 811 [panel beginSheetForDirectory: nil file: nil types: nil modalForWindow: fWindow modalDelegate: self … … 2203 2207 NSEnumerator * enumerator = [files objectEnumerator]; 2204 2208 NSString * file; 2205 tr_torrent_t * tempTor;2206 2209 int canAdd; 2207 2210 while ((file = [enumerator nextObject])) … … 2210 2213 if (canAdd == TR_OK) 2211 2214 { 2212 tr_torrentClose(tempTor);2213 2215 [filesToOpen addObject: file]; 2214 2215 2216 torrent = YES; 2216 2217 } -
trunk/macosx/DragOverlayWindow.m
r2211 r2218 85 85 tr_info_t info; 86 86 while ((file = [enumerator nextObject])) 87 { 87 88 if (tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK) 88 89 { … … 98 99 } 99 100 } 101 tr_metainfoFree(&info); 102 } 100 103 101 104 if (count <= 0)
Note: See TracChangeset
for help on using the changeset viewer.