Changeset 8474


Ignore:
Timestamp:
May 22, 2009, 2:52:51 AM (12 years ago)
Author:
livings124
Message:

(1.6x) cleanup last commit(s)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6x/macosx/Torrent.m

    r8472 r8474  
    16311631        tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
    16321632       
    1633         tr_info info;
    16341633        int result = TR_EINVALID;
    16351634        if (path)
    1636         {
    1637             tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
     1635            result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
     1636       
     1637        //backup - shouldn't be needed after upgrade to 1.62
     1638        if (result != TR_OK && hashString)
     1639            tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
     1640       
     1641        if (result == TR_OK)
     1642        {
     1643            tr_info info;
    16381644            result = tr_torrentParse(ctor, &info);
    1639         }
    1640         if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
    1641         {
    1642             tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
    1643             result = tr_torrentParse(ctor, &info);
    1644         }
    1645        
    1646         if (result == TR_OK)
    1647         {
    1648             NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
    1649                                                 ? fIncompleteFolder : fDownloadFolder;
    1650             tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
    16511645           
    1652             fHandle = tr_torrentNew(ctor, NULL);
    1653         }
    1654         if (result != TR_EINVALID)
    1655             tr_metainfoFree(&info);
     1646            if (result == TR_OK)
     1647            {
     1648                NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
     1649                                                    ? fIncompleteFolder : fDownloadFolder;
     1650                tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
     1651               
     1652                fHandle = tr_torrentNew(ctor, NULL);
     1653            }
     1654            if (result != TR_EINVALID)
     1655                tr_metainfoFree(&info);
     1656        }
    16561657       
    16571658        tr_ctorFree(ctor);
Note: See TracChangeset for help on using the changeset viewer.