Changeset 8471


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

remove a little redundant code from the last commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r8470 r8471  
    16381638       
    16391639        tr_info info;
     1640        int result = TR_EINVALID;
    16401641        if (path)
    16411642        {
    16421643            tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
    1643             if (tr_torrentParse(ctor, &info) == TR_OK)
    1644             {
    1645                 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
    1646                                                     ? fIncompleteFolder : fDownloadFolder;
    1647                 tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
    1648                
    1649                 fHandle = tr_torrentNew(ctor, NULL);
    1650             }
     1644            result = tr_torrentParse(ctor, &info);
     1645        }
     1646        if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
     1647        {
     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           
     1658            fHandle = tr_torrentNew(ctor, NULL);
     1659        }
     1660        if (result != TR_EINVALID)
    16511661            tr_metainfoFree(&info);
    1652         }
    1653         if (!fHandle && hashString) //backup - shouldn't be needed after upgrade to 1.70
    1654         {
    1655             tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
    1656             if (tr_torrentParse(ctor, &info) == TR_OK)
    1657             {
    1658                 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
    1659                                                     ? fIncompleteFolder : fDownloadFolder;
    1660                 tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
    1661                
    1662                 fHandle = tr_torrentNew(ctor, NULL);
    1663             }
    1664             tr_metainfoFree(&info);
    1665         }
    16661662       
    16671663        tr_ctorFree(ctor);
Note: See TracChangeset for help on using the changeset viewer.