Changeset 8470
- Timestamp:
- May 22, 2009, 2:08:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.m
r8439 r8470 31 31 @interface Torrent (Private) 32 32 33 - (id) initWith Hash: (NSString *) hashString path: (NSString *) pathtorrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib33 - (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib 34 34 publicTorrent: (NSNumber *) publicTorrent 35 35 downloadFolder: (NSString *) downloadFolder … … 84 84 lib: (tr_session *) lib 85 85 { 86 self = [self initWith Hash: nil path: pathtorrentStruct: NULL lib: lib86 self = [self initWithPath: path hash: nil torrentStruct: NULL lib: lib 87 87 publicTorrent: torrentDelete != TORRENT_FILE_DEFAULT ? [NSNumber numberWithBool: torrentDelete == TORRENT_FILE_SAVE] : nil 88 88 downloadFolder: location … … 108 108 - (id) initWithTorrentStruct: (tr_torrent *) torrentStruct location: (NSString *) location lib: (tr_session *) lib 109 109 { 110 self = [self initWith Hash: nil path: nil torrentStruct: torrentStruct lib: lib110 self = [self initWithPath: nil hash: nil torrentStruct: torrentStruct lib: lib 111 111 publicTorrent: [NSNumber numberWithBool: NO] 112 112 downloadFolder: location … … 119 119 - (id) initWithHistory: (NSDictionary *) history lib: (tr_session *) lib forcePause: (BOOL) pause 120 120 { 121 self = [self initWithHash: [history objectForKey: @"TorrentHash"] 122 path: [history objectForKey: @"TorrentPath"] torrentStruct: NULL lib: lib 121 self = [self initWithPath: [history objectForKey: @"InternalTorrentPath"] 122 hash: [history objectForKey: @"TorrentHash"] 123 torrentStruct: NULL lib: lib 123 124 publicTorrent: [history objectForKey: @"PublicCopy"] 124 125 downloadFolder: [history objectForKey: @"DownloadFolder"] … … 169 170 { 170 171 NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys: 172 [self torrentLocation], @"InternalTorrentPath", 173 [self hashString], @"TorrentHash", 171 174 [NSNumber numberWithBool: fPublicTorrent], @"PublicCopy", 172 [self hashString], @"TorrentHash",173 175 fDownloadFolder, @"DownloadFolder", 174 176 [NSNumber numberWithBool: fUseIncompleteFolder], @"UseIncompleteFolder", … … 1592 1594 1593 1595 //if a hash is given, attempt to load that; otherwise, attempt to open file at path 1594 - (id) initWith Hash: (NSString *) hashString path: (NSString *) pathtorrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib1596 - (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib 1595 1597 publicTorrent: (NSNumber *) publicTorrent 1596 1598 downloadFolder: (NSString *) downloadFolder … … 1636 1638 1637 1639 tr_info info; 1638 if ( hashString)1639 { 1640 tr_ctorSetMetainfoFrom Hash(ctor, [hashStringUTF8String]);1640 if (path) 1641 { 1642 tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]); 1641 1643 if (tr_torrentParse(ctor, &info) == TR_OK) 1642 1644 { … … 1649 1651 tr_metainfoFree(&info); 1650 1652 } 1651 if (!fHandle && path)1652 { 1653 tr_ctorSetMetainfoFrom File(ctor, [pathUTF8String]);1653 if (!fHandle && hashString) //backup - shouldn't be needed after upgrade to 1.70 1654 { 1655 tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]); 1654 1656 if (tr_torrentParse(ctor, &info) == TR_OK) 1655 1657 {
Note: See TracChangeset
for help on using the changeset viewer.