Changeset 8473
- Timestamp:
- May 22, 2009, 2:52:28 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.m
r8471 r8473 1593 1593 @implementation Torrent (Private) 1594 1594 1595 //if a hash is given, attempt to load that; otherwise, attempt to open file at path1596 1595 - (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib 1597 1596 publicTorrent: (NSNumber *) publicTorrent … … 1637 1636 tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]); 1638 1637 1639 tr_info info;1640 1638 int result = TR_EINVALID; 1641 1639 if (path) 1642 { 1643 tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]); 1640 result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]); 1641 1642 //backup - shouldn't be needed after upgrade to 1.62 1643 if (result != TR_OK && hashString) 1644 tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]); 1645 1646 if (result == TR_OK) 1647 { 1648 tr_info info; 1644 1649 result = tr_torrentParse(ctor, &info); 1645 }1646 if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.701647 {1648 tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);1649 result = tr_torrentParse(ctor, &info);1650 }1651 1652 if (result == TR_OK)1653 {1654 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]1655 ? fIncompleteFolder : fDownloadFolder;1656 tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);1657 1650 1658 fHandle = tr_torrentNew(ctor, NULL); 1659 } 1660 if (result != TR_EINVALID) 1661 tr_metainfoFree(&info); 1651 if (result == TR_OK) 1652 { 1653 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] 1654 ? fIncompleteFolder : fDownloadFolder; 1655 tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]); 1656 1657 fHandle = tr_torrentNew(ctor, NULL); 1658 } 1659 if (result != TR_EINVALID) 1660 tr_metainfoFree(&info); 1661 } 1662 1662 1663 1663 tr_ctorFree(ctor);
Note: See TracChangeset
for help on using the changeset viewer.