Changeset 299
- Timestamp:
- Jun 8, 2006, 6:59:04 AM (17 years ago)
- Location:
- branches/save_torrent_files
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/save_torrent_files/libtransmission/metainfo.c
r289 r299 121 121 if( !file ) 122 122 { 123 fprintf( stderr, "Could not open file (%s) \n", inf->torrent);123 fprintf( stderr, "Could not open file (%s) (%s)\n", inf->torrent, strerror(errno) ); 124 124 tr_bencFree( &meta ); 125 125 free( buf ); -
branches/save_torrent_files/macosx/Torrent.h
r294 r299 40 40 NSDate * fDate; 41 41 42 BOOL fPrivate Saved;42 BOOL fPrivateTorrent; 43 43 44 44 NSUserDefaults * fDefaults; -
branches/save_torrent_files/macosx/Torrent.m
r295 r299 44 44 45 45 - (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib 46 { NSLog(path);46 { 47 47 id torrent = [self initWithPath: path lib: lib date: nil 48 48 stopRatioSetting: nil ratioLimit: nil]; … … 51 51 return nil; 52 52 53 if (fPrivate Saved&& [fDefaults boolForKey: @"DeleteOriginalTorrent"])53 if (fPrivateTorrent && [fDefaults boolForKey: @"DeleteOriginalTorrent"]) 54 54 [self trashPath: path]; 55 55 … … 59 59 - (id) initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib 60 60 { 61 //load from saved torrent file if set to, otherwise try to load from where torrent file should be 61 62 NSNumber * privateCopy; 62 63 if ((privateCopy = [history objectForKey: @"PrivateCopy"]) && [privateCopy boolValue]) … … 89 90 { 90 91 NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys: 91 [NSNumber numberWithBool: fPrivate Saved], @"PrivateCopy",92 [NSNumber numberWithBool: fPrivateTorrent], @"PrivateCopy", 92 93 [self downloadFolder], @"DownloadFolder", 93 94 [self isActive] ? @"NO" : @"YES", @"Paused", … … 96 97 [NSNumber numberWithFloat: fRatioLimit], @"RatioLimit", nil]; 97 98 98 if (fPrivateSaved) 99 if (fPrivateTorrent) 100 [history setObject: [self hashString] forKey: @"TorrentHash"]; 101 else 99 102 [history setObject: [self torrentLocation] forKey: @"TorrentPath"]; 100 else101 [history setObject: [self hashString] forKey: @"TorrentHash"];102 103 103 104 return history; … … 240 241 - (void) removeForever 241 242 { 242 tr_torrentRemoveSaved(fHandle); 243 if (fInfo->flags & TR_FSAVEPRIVATE) 244 tr_torrentRemoveSaved(fHandle); 243 245 } 244 246 … … 508 510 fDefaults = [NSUserDefaults standardUserDefaults]; 509 511 510 fPrivate Saved= [fDefaults boolForKey: @"SavePrivateTorrent"];512 fPrivateTorrent = [fDefaults boolForKey: @"SavePrivateTorrent"]; 511 513 512 514 int error; 513 515 if (!path || !(fHandle = tr_torrentInit(fLib, [path UTF8String], 514 fPrivate Saved? TR_FSAVEPRIVATE : 0, & error)))516 fPrivateTorrent ? TR_FSAVEPRIVATE : 0, & error))) 515 517 { 516 518 [self release]; … … 530 532 fDefaults = [NSUserDefaults standardUserDefaults]; 531 533 532 fPrivate Saved= YES;534 fPrivateTorrent = YES; 533 535 534 536 int error;
Note: See TracChangeset
for help on using the changeset viewer.