Changeset 292
- Timestamp:
- Jun 8, 2006, 4:44:45 AM (16 years ago)
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/save_torrent_files/Transmission.xcodeproj/project.pbxproj
r291 r292 81 81 A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.tiff */; }; 82 82 A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; }; 83 A2495B6D0A2F697C0098B31F /* ResumeSelected.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2495B6B0A2F697C0098B31F /* ResumeSelected.tiff */; }; 84 A2495B6E0A2F697D0098B31F /* PauseSelected.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2495B6C0A2F697C0098B31F /* PauseSelected.tiff */; }; 83 85 A2519D490A2FADFC00479D0C /* SmoothAquaView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2519D470A2FADFC00479D0C /* SmoothAquaView.m */; }; 84 86 A2519D4A0A2FADFC00479D0C /* SmoothAquaView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2519D480A2FADFC00479D0C /* SmoothAquaView.h */; }; … … 93 95 A2D5CCFD0A2661590089A8C2 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2D5CCFC0A2661590089A8C2 /* Sparkle.framework */; }; 94 96 A2D5CD100A2661610089A8C2 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2D5CCFC0A2661590089A8C2 /* Sparkle.framework */; }; 95 A2DB22970A37CA4200489FF1 /* PauseSelected.png in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2DB22950A37CA4200489FF1 /* PauseSelected.png */; };96 A2DB22980A37CA4200489FF1 /* ResumeSelected.png in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2DB22960A37CA4200489FF1 /* ResumeSelected.png */; };97 97 A2F40AE40A361C00006B8288 /* Transmission.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4D2784360905709500687951 /* Transmission.icns */; }; 98 98 A2F8951F0A2D4BA500ED2127 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = A2F8951E0A2D4BA500ED2127 /* Credits.rtf */; }; … … 123 123 dstSubfolderSpec = 10; 124 124 files = ( 125 A2DB22970A37CA4200489FF1 /* PauseSelected.png in CopyFiles */,126 A2DB22980A37CA4200489FF1 /* ResumeSelected.png in CopyFiles */,127 125 ); 128 126 runOnlyForDeploymentPostprocessing = 0; … … 222 220 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; }; 223 221 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; }; 224 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };222 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; }; 225 223 4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; }; 226 224 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; }; … … 250 248 A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ActionButtonPressed.tiff; path = macosx/Images/ActionButtonPressed.tiff; sourceTree = "<group>"; }; 251 249 A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; }; 250 A2495B6B0A2F697C0098B31F /* ResumeSelected.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ResumeSelected.tiff; path = macosx/Images/ResumeSelected.tiff; sourceTree = "<group>"; }; 251 A2495B6C0A2F697C0098B31F /* PauseSelected.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = PauseSelected.tiff; path = macosx/Images/PauseSelected.tiff; sourceTree = "<group>"; }; 252 252 A2519D470A2FADFC00479D0C /* SmoothAquaView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SmoothAquaView.m; path = macosx/SmoothAquaView.m; sourceTree = "<group>"; }; 253 253 A2519D480A2FADFC00479D0C /* SmoothAquaView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SmoothAquaView.h; path = macosx/SmoothAquaView.h; sourceTree = "<group>"; }; … … 262 262 A2C655640A04FEDC00E9FD82 /* BottomBorder.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BottomBorder.tiff; path = macosx/Images/BottomBorder.tiff; sourceTree = "<group>"; }; 263 263 A2D5CCFC0A2661590089A8C2 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; }; 264 A2DB22950A37CA4200489FF1 /* PauseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseSelected.png; path = macosx/Images/PauseSelected.png; sourceTree = "<group>"; };265 A2DB22960A37CA4200489FF1 /* ResumeSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeSelected.png; path = macosx/Images/ResumeSelected.png; sourceTree = "<group>"; };266 264 A2F8951E0A2D4BA500ED2127 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Credits.rtf; path = macosx/Credits.rtf; sourceTree = "<group>"; }; 267 265 /* End PBXFileReference section */ … … 355 353 children = ( 356 354 A2F8951E0A2D4BA500ED2127 /* Credits.rtf */, 357 A2 DB22950A37CA4200489FF1 /* PauseSelected.png*/,358 A2 DB22960A37CA4200489FF1 /* ResumeSelected.png*/,355 A2495B6B0A2F697C0098B31F /* ResumeSelected.tiff */, 356 A2495B6C0A2F697C0098B31F /* PauseSelected.tiff */, 359 357 A21DFF0F0A292B2B007C5F76 /* Transfers.png */, 360 358 A27A53640A06AED200E1F16F /* StatusBorder.tiff */, … … 622 620 A2912C540A2956E80097A0CA /* PrefsWindow.nib in Resources */, 623 621 A2F8951F0A2D4BA500ED2127 /* Credits.rtf in Resources */, 622 A2495B6D0A2F697C0098B31F /* ResumeSelected.tiff in Resources */, 623 A2495B6E0A2F697D0098B31F /* PauseSelected.tiff in Resources */, 624 624 A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.tiff in Resources */, 625 625 A28DBADC0A33C1D800F4B4A7 /* ActionButton.tiff in Resources */, -
trunk/macosx/Controller.h
r291 r292 97 97 98 98 - (void) removeTorrent: (id) sender; 99 - (void) removeTorrentDeleteTorrent: (id) sender; 99 100 - (void) removeTorrentDeleteData: (id) sender; 101 - (void) removeTorrentDeleteBoth: (id) sender; 100 102 - (void) removeTorrentWithIndex: (NSIndexSet *) indexSet 103 deleteTorrent: (BOOL) deleteTorrent 101 104 deleteData: (BOOL) deleteData; 102 105 … … 104 107 contextInfo: (NSDictionary *) dict; 105 108 - (void) confirmRemoveTorrents: (NSArray *) torrents 109 deleteTorrent: (BOOL) deleteTorrent 106 110 deleteData: (BOOL) deleteData; 107 111 -
trunk/macosx/Controller.m
r291 r292 525 525 526 526 - (void) removeTorrentWithIndex: (NSIndexSet *) indexSet 527 deleteTorrent: (BOOL) deleteTorrent 527 528 deleteData: (BOOL) deleteData 528 529 { … … 540 541 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: 541 542 torrents, @"Torrents", 543 [NSNumber numberWithBool: deleteTorrent], @"DeleteTorrent", 542 544 [NSNumber numberWithBool: deleteData], @"DeleteData", 543 545 nil]; … … 571 573 { 572 574 [self confirmRemoveTorrents: torrents 575 deleteTorrent: deleteTorrent 573 576 deleteData: deleteData]; 574 577 } … … 581 584 582 585 NSArray * torrents = [dict objectForKey: @"Torrents"]; 586 BOOL deleteTorrent = [[dict objectForKey: @"DeleteTorrent"] boolValue]; 583 587 BOOL deleteData = [[dict objectForKey: @"DeleteData"] boolValue]; 584 588 [dict release]; … … 587 591 { 588 592 [self confirmRemoveTorrents: torrents 593 deleteTorrent: deleteTorrent 589 594 deleteData: deleteData]; 590 595 } … … 594 599 595 600 - (void) confirmRemoveTorrents: (NSArray *) torrents 601 deleteTorrent: (BOOL) deleteTorrent 596 602 deleteData: (BOOL) deleteData 597 603 { … … 604 610 if( deleteData ) 605 611 [torrent trashData]; 606 607 [torrent removeForever]; 612 613 if( deleteTorrent ) 614 [torrent trashTorrent]; 615 608 616 [fTorrents removeObject: torrent]; 609 617 } … … 618 626 - (void) removeTorrent: (id) sender 619 627 { 620 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteData: NO]; 628 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteTorrent: NO deleteData: NO]; 629 } 630 631 - (void) removeTorrentDeleteTorrent: (id) sender 632 { 633 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteTorrent: YES deleteData: NO]; 621 634 } 622 635 623 636 - (void) removeTorrentDeleteData: (id) sender 624 637 { 625 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteData: YES]; 638 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteTorrent: NO deleteData: YES]; 639 } 640 641 - (void) removeTorrentDeleteBoth: (id) sender 642 { 643 [self removeTorrentWithIndex: [fTableView selectedRowIndexes] deleteTorrent: YES deleteData: YES]; 626 644 } 627 645 … … 1192 1210 1193 1211 //enable remove items 1194 if (action == @selector(removeTorrent:) || action == @selector(removeTorrentDeleteData:)) 1212 if (action == @selector(removeTorrent:) 1213 || action == @selector(removeTorrentDeleteTorrent:) 1214 || action == @selector(removeTorrentDeleteData:) 1215 || action == @selector(removeTorrentDeleteBoth:)) 1195 1216 { 1196 1217 BOOL active = NO; -
trunk/macosx/Defaults.plist
r291 r292 19 19 <key>CheckUpload</key> 20 20 <true/> 21 <key>DeleteOriginalTorrent</key>22 <false/>23 21 <key>DownloadChoice</key> 24 22 <string>Constant</string> … … 43 41 <key>SUScheduledCheckInterval</key> 44 42 <integer>86400</integer> 45 <key>SavePrivateTorrent</key>46 <true/>47 43 <key>ShowInspector</key> 48 44 <false/> -
trunk/macosx/English.lproj/MainMenu.nib/classes.nib
r291 r292 10 10 openShowSheet = id; 11 11 removeTorrent = id; 12 removeTorrentDeleteBoth = id; 12 13 removeTorrentDeleteData = id; 14 removeTorrentDeleteTorrent = id; 13 15 resumeAllTorrents = id; 14 16 resumeTorrent = id; -
trunk/macosx/English.lproj/MainMenu.nib/info.nib
r291 r292 30 30 <key>IBOpenObjects</key> 31 31 <array> 32 <integer>2 9</integer>32 <integer>21</integer> 33 33 <integer>1480</integer> 34 <integer>21</integer>35 34 </array> 36 35 <key>IBSystem Version</key> -
trunk/macosx/English.lproj/PrefsWindow.nib/classes.nib
r291 r292 11 11 setLimit = id; 12 12 setLimitCheck = id; 13 setMoveTorrent = id;14 13 setPort = id; 15 14 setRatio = id; … … 24 23 fBadgeDownloadRateCheck = NSButton; 25 24 fBadgeUploadRateCheck = NSButton; 26 fCopyTorrentCheck = NSButton;27 fDeleteOriginalTorrentCheck = NSButton;28 25 fDownloadCheck = NSButton; 29 26 fDownloadField = NSTextField; -
trunk/macosx/English.lproj/PrefsWindow.nib/info.nib
r291 r292 8 8 <dict> 9 9 <key>28</key> 10 <string>34 5472 462 212 0 0 1152 842 </string>10 <string>347 472 462 212 0 0 1152 842 </string> 11 11 <key>41</key> 12 <string> 262 506 462 274 0 0 1152 842 </string>12 <string>345 461 462 234 0 0 1152 842 </string> 13 13 <key>66</key> 14 14 <string>347 526 462 104 0 0 1152 842 </string> -
trunk/macosx/PrefsController.h
r291 r292 37 37 IBOutlet NSButton * fQuitCheck, * fRemoveCheck, 38 38 * fBadgeDownloadRateCheck, * fBadgeUploadRateCheck, 39 * fAutoStartCheck , * fCopyTorrentCheck, * fDeleteOriginalTorrentCheck;39 * fAutoStartCheck; 40 40 IBOutlet NSPopUpButton * fUpdatePopUp; 41 41 … … 59 59 - (void) checkUpdate; 60 60 - (void) setAutoStart: (id) sender; 61 - (void) setMoveTorrent: (id) sender;62 61 - (void) setDownloadLocation: (id) sender; 63 62 - (void) folderSheetShow: (id) sender; -
trunk/macosx/PrefsController.m
r291 r292 117 117 int uploadLimit = [fDefaults integerForKey: @"UploadLimit"]; 118 118 119 [fUploadCheck setState: checkUpload ];119 [fUploadCheck setState: checkUpload ? NSOnState : NSOffState]; 120 120 [fUploadField setIntValue: uploadLimit]; 121 121 [fUploadField setEnabled: checkUpload]; … … 127 127 int downloadLimit = [fDefaults integerForKey: @"DownloadLimit"]; 128 128 129 [fDownloadCheck setState: checkDownload ];129 [fDownloadCheck setState: checkDownload ? NSOnState : NSOffState]; 130 130 [fDownloadField setIntValue: downloadLimit]; 131 131 [fDownloadField setEnabled: checkDownload]; … … 135 135 //set ratio limit 136 136 BOOL ratioCheck = [fDefaults boolForKey: @"RatioCheck"]; 137 [fRatioCheck setState: ratioCheck ];137 [fRatioCheck setState: ratioCheck ? NSOnState : NSOffState]; 138 138 [fRatioField setEnabled: ratioCheck]; 139 139 [fRatioField setFloatValue: [fDefaults floatForKey: @"RatioLimit"]]; 140 140 141 141 //set remove and quit prompts 142 [fQuitCheck setState: [fDefaults boolForKey: @"CheckQuit"]]; 143 [fRemoveCheck setState: [fDefaults boolForKey: @"CheckRemove"]]; 142 [fQuitCheck setState: [fDefaults boolForKey: @"CheckQuit"] ? 143 NSOnState : NSOffState]; 144 [fRemoveCheck setState: [fDefaults boolForKey: @"CheckRemove"] ? 145 NSOnState : NSOffState]; 144 146 145 147 //set dock badging … … 149 151 //set auto start 150 152 [fAutoStartCheck setState: [fDefaults boolForKey: @"AutoStartDownload"]]; 151 152 //set private torrents153 BOOL copyTorrents = [fDefaults boolForKey: @"SavePrivateTorrent"];154 [fCopyTorrentCheck setState: copyTorrents];155 156 [fDeleteOriginalTorrentCheck setEnabled: copyTorrents];157 [fDeleteOriginalTorrentCheck setState: [fDefaults boolForKey: @"DeleteOriginalTorrent"]];158 153 159 154 //set update check … … 423 418 { 424 419 [fDefaults setBool: [sender state] forKey: @"AutoStartDownload"]; 425 }426 427 - (void) setMoveTorrent: (id) sender428 {429 int state = [sender state];430 if (sender == fCopyTorrentCheck)431 {432 [fDefaults setBool: state forKey: @"SavePrivateTorrent"];433 434 [fDeleteOriginalTorrentCheck setEnabled: state];435 if (state == NSOffState)436 {437 [fDeleteOriginalTorrentCheck setState: NSOffState];438 [fDefaults setBool: NO forKey: @"DeleteOriginalTorrent"];439 }440 }441 else442 [fDefaults setBool: state forKey: @"DeleteOriginalTorrent"];443 420 } 444 421 -
trunk/macosx/Torrent.h
r291 r292 36 36 tr_info_t * fInfo; 37 37 tr_stat_t * fStat; 38 39 38 BOOL fResumeOnWake; 40 39 NSDate * fDate; 41 42 BOOL fPrivateSaved;43 40 44 41 NSUserDefaults * fDefaults; … … 59 56 - (void) getAvailability: (int8_t *) tab size: (int) size; 60 57 61 - (void) update; 62 - (void) start; 63 - (void) stop; 64 - (void) removeForever; 65 - (void) sleep; 66 - (void) wakeUp; 58 - (void) update; 59 - (void) start; 60 - (void) stop; 61 - (void) sleep; 62 - (void) wakeUp; 67 63 68 64 - (float) ratio; … … 73 69 74 70 - (void) reveal; 71 - (void) trashTorrent; 75 72 - (void) trashData; 76 73 -
trunk/macosx/Torrent.m
r291 r292 29 29 @interface Torrent (Private) 30 30 31 - (void) trashPath: (NSString *) path; 31 32 - (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib date: (NSDate *) date 32 33 stopRatioSetting: (NSNumber *) stopRatioSetting ratioLimit: (NSNumber *) ratioLimit; 33 - (id) initWithHash: (NSString *) hashString lib: (tr_handle_t *) lib date: (NSDate *) date34 stopRatioSetting: (NSNumber *) stopRatioSetting ratioLimit: (NSNumber *) ratioLimit;35 - (id) initForSuccessWithDate: (NSDate *) date stopRatioSetting: (NSNumber *)36 stopRatioSetting ratioLimit: (NSNumber *) ratioLimit;37 38 - (void) trashPath: (NSString *) path;39 34 40 35 @end … … 45 40 - (id) initWithPath: (NSString *) path lib: (tr_handle_t *) lib 46 41 { 47 id torrent = [self initWithPath: path lib: lib 48 date: nil stopRatioSetting: nil 49 ratioLimit: nil]; 50 NSLog(path); 51 if (fPrivateSaved && [fDefaults boolForKey: @"DeleteOriginalTorrent"]) 52 [self trashPath: path]; 53 54 return torrent; 42 return [self initWithPath: path lib: lib 43 date: nil stopRatioSetting: nil 44 ratioLimit: nil]; 55 45 } 56 46 57 47 - (id) initWithHistory: (NSDictionary *) history lib: (tr_handle_t *) lib 58 48 { 59 NSNumber * privateCopy; 60 if ((privateCopy = [history objectForKey: @"PrivateCopy"]) && [privateCopy boolValue]) 61 self = [self initWithHash: [history objectForKey: @"TorrentHash"] 62 lib: lib date: [history objectForKey: @"Date"] 63 stopRatioSetting: [history objectForKey: @"StopRatioSetting"] 64 ratioLimit: [history objectForKey: @"RatioLimit"]]; 65 else 66 self = [self initWithPath: [history objectForKey: @"TorrentPath"] 49 self = [self initWithPath: [history objectForKey: @"TorrentPath"] 67 50 lib: lib date: [history objectForKey: @"Date"] 68 51 stopRatioSetting: [history objectForKey: @"StopRatioSetting"] … … 86 69 - (NSDictionary *) history 87 70 { 88 NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys: 89 [NSNumber numberWithBool: fPrivateSaved], @"PrivateCopy", 90 [self downloadFolder], @"DownloadFolder", 91 [self isActive] ? @"NO" : @"YES", @"Paused", 92 [self date], @"Date", 93 [NSNumber numberWithInt: fStopRatioSetting], @"StopRatioSetting", 94 [NSNumber numberWithFloat: fRatioLimit], @"RatioLimit", nil]; 95 96 if (fPrivateSaved) 97 [history setObject: [self torrentLocation] forKey: @"TorrentPath"]; 98 else 99 [history setObject: [self hashString] forKey: @"TorrentHash"]; 100 101 return history; 71 return [NSDictionary dictionaryWithObjectsAndKeys: 72 [self torrentLocation], @"TorrentPath", 73 [self downloadFolder], @"DownloadFolder", 74 [self isActive] ? @"NO" : @"YES", @"Paused", 75 [self date], @"Date", 76 [NSNumber numberWithInt: fStopRatioSetting], @"StopRatioSetting", 77 [NSNumber numberWithFloat: fRatioLimit], @"RatioLimit", nil]; 102 78 } 103 79 … … 237 213 } 238 214 239 - (void) removeForever240 {241 tr_torrentRemoveSaved(fHandle);242 }243 244 215 - (void) sleep 245 216 { … … 291 262 } 292 263 264 - (void) trashTorrent 265 { 266 [self trashPath: [self torrentLocation]]; 267 } 268 293 269 - (void) trashData 294 270 { … … 339 315 - (NSString *) hashString 340 316 { 341 /*NSMutableString * string = [NSMutableString317 NSMutableString * string = [NSMutableString 342 318 stringWithCapacity: SHA_DIGEST_LENGTH]; 343 319 int i; … … 346 322 [string appendFormat: @"%02x", fInfo->hash[i]]; 347 323 } 348 return string;*/ 349 350 return [NSString stringWithUTF8String: fInfo->hashString]; 324 return string; 351 325 } 352 326 353 327 - (NSString *) torrentLocation 354 328 { 355 return [NSString stringWithUTF8String: fInfo->torrent]; 329 return [NSString stringWithUTF8String: fInfo->torrent];; 356 330 } 357 331 … … 514 488 515 489 fLib = lib; 516 fDefaults = [NSUserDefaults standardUserDefaults];517 518 fPrivateSaved = [fDefaults boolForKey: @"SavePrivateTorrent"];519 490 520 491 int error; 521 if (!path || !(fHandle = tr_torrentInit(fLib, [path UTF8String], 522 fPrivateSaved ? TR_FSAVEPRIVATE : 0, &error))) 492 if (!path || !(fHandle = tr_torrentInit(fLib, [path UTF8String], &error))) 523 493 { 524 494 [self release]; … … 526 496 } 527 497 528 return [self initForSuccessWithDate: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit]; 529 } 530 531 - (id) initWithHash: (NSString *) hashString lib: (tr_handle_t *) lib date: (NSDate *) date 532 stopRatioSetting: (NSNumber *) stopRatioSetting ratioLimit: (NSNumber *) ratioLimit 533 { 534 if (!(self = [super init])) 535 return nil; 536 537 fLib = lib; 498 fInfo = tr_torrentInfo( fHandle ); 499 538 500 fDefaults = [NSUserDefaults standardUserDefaults]; 539 540 fPrivateSaved = YES;541 542 int error;543 if (!hashString || !(fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], TR_FSAVEPRIVATE, &error)))544 {545 [self release];546 return nil;547 }548 549 return [self initForSuccessWithDate: date stopRatioSetting: stopRatioSetting ratioLimit: ratioLimit];550 }551 552 - (id) initForSuccessWithDate: (NSDate *) date stopRatioSetting: (NSNumber *)553 stopRatioSetting ratioLimit: (NSNumber *) ratioLimit554 {555 fInfo = tr_torrentInfo( fHandle );556 501 557 502 fDate = date ? [date retain] : [[NSDate alloc] init]; … … 573 518 return self; 574 519 } 575 576 520 577 521 - (void) trashPath: (NSString *) path
Note: See TracChangeset
for help on using the changeset viewer.