Changeset 362
- Timestamp:
- Jun 15, 2006, 2:35:40 AM (17 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/English.lproj/MainMenu.nib/info.nib
r361 r362 14 14 <string>189 691 451 44 0 0 1152 842 </string> 15 15 <key>456</key> 16 <string>396 374 216 1680 0 1152 842 </string>16 <string>396 374 216 206 0 0 1152 842 </string> 17 17 <key>581</key> 18 18 <string>324 628 112 68 0 0 1152 842 </string> … … 31 31 <array> 32 32 <integer>21</integer> 33 <integer>29</integer> 33 34 </array> 34 35 <key>IBSystem Version</key> -
trunk/macosx/Torrent.m
r361 r362 33 33 date: (NSDate *) date stopRatioSetting: (NSNumber *) stopRatioSetting 34 34 ratioLimit: (NSNumber *) ratioLimit; 35 - (id) initForSuccessWith Date: (NSDate *) date stopRatioSetting: (NSNumber *)35 - (id) initForSuccessWithPath: (NSString *) path date: (NSDate *) date stopRatioSetting: (NSNumber *) 36 36 stopRatioSetting ratioLimit: (NSNumber *) ratioLimit; 37 37 … … 45 45 - (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib 46 46 { 47 fPrivateTorrent = [fDefaults boolForKey: @"SavePrivateTorrent"]; 48 fPublicTorrent = !fPrivateTorrent || ![fDefaults boolForKey: @"DeleteOriginalTorrent"]; 49 47 50 id torrent = [self initWithPath: path lib: lib date: nil 48 51 stopRatioSetting: nil ratioLimit: nil]; … … 50 53 if (torrent) 51 54 { 52 fPrivateTorrent = [fDefaults boolForKey: @"SavePrivateTorrent"];53 fPublicTorrent = !fPrivateTorrent || ![fDefaults boolForKey: @"DeleteOriginalTorrent"];54 55 55 if (!fPublicTorrent) 56 56 { 57 57 [self trashFile: path]; 58 59 [fPublicTorrentLocation release]; 58 60 fPublicTorrentLocation = nil; 59 61 } 60 else61 fPublicTorrentLocation = [path retain];62 62 } 63 63 … … 67 67 - (id) initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib 68 68 { 69 //load from saved torrent file if set to, otherwise try to load from where torrent file should be70 69 id torrent; 71 70 NSNumber * privateCopy, * publicCopy; … … 73 72 fPublicTorrent = !fPrivateTorrent || ((publicCopy = [history objectForKey: @"PublicCopy"]) 74 73 && [publicCopy boolValue]); 75 NSString * path = [history objectForKey: @"TorrentPath"];76 74 75 //load from saved torrent file if set to, otherwise try to load from where torrent file should be 77 76 if (fPrivateTorrent) 78 77 torrent = [self initWithHash: [history objectForKey: @"TorrentHash"] 79 path: [history objectForKey: @"TorrentPath"] lib: lib80 date: [history objectForKey: @"Date"]78 path: [history objectForKey: @"TorrentPath"] 79 lib: lib date: [history objectForKey: @"Date"] 81 80 stopRatioSetting: [history objectForKey: @"StopRatioSetting"] 82 81 ratioLimit: [history objectForKey: @"RatioLimit"]]; … … 89 88 if (torrent) 90 89 { 91 if (fPublicTorrent)92 fPublicTorrentLocation = [path retain];93 94 90 NSString * downloadFolder; 95 91 if (!(downloadFolder = [history objectForKey: @"DownloadFolder"])) … … 120 116 121 117 if (fPublicTorrent) 122 [history setObject: [self torrentLocation] forKey: @"TorrentPath"];118 [history setObject: [self publicTorrentLocation] forKey: @"TorrentPath"]; 123 119 124 120 return history; … … 561 557 fLib = lib; 562 558 fDefaults = [NSUserDefaults standardUserDefaults]; 563 fPublicTorrentLocation = path;564 559 565 560 int error; … … 571 566 } 572 567 573 return [self initForSuccessWith Date: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit];568 return [self initForSuccessWithPath: path date: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit]; 574 569 } 575 570 … … 583 578 fLib = lib; 584 579 fDefaults = [NSUserDefaults standardUserDefaults]; 585 fPublicTorrentLocation = path;586 580 587 581 int error; … … 592 586 } 593 587 594 return [self initForSuccessWith Date: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit];595 } 596 597 - (id) initForSuccessWith Date: (NSDate *) date stopRatioSetting: (NSNumber *)588 return [self initForSuccessWithPath: path date: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit]; 589 } 590 591 - (id) initForSuccessWithPath: (NSString *) path date: (NSDate *) date stopRatioSetting: (NSNumber *) 598 592 stopRatioSetting ratioLimit: (NSNumber *) ratioLimit 599 593 { 600 594 fInfo = tr_torrentInfo( fHandle ); 595 596 if (path) 597 fPublicTorrentLocation = [path retain]; 601 598 602 599 fDate = date ? [date retain] : [[NSDate alloc] init];
Note: See TracChangeset
for help on using the changeset viewer.