1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-03 04:53:27 +00:00

remove a little redundant code from the last commit

This commit is contained in:
Mitchell Livingston 2009-05-22 02:26:02 +00:00
parent d3370ef29e
commit c36a007cd4

View file

@ -1637,23 +1637,19 @@ int trashDataFile(const char * filename)
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
tr_info info;
int result = TR_EINVALID;
if (path)
{
tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
if (tr_torrentParse(ctor, &info) == TR_OK)
{
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
? fIncompleteFolder : fDownloadFolder;
tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
fHandle = tr_torrentNew(ctor, NULL);
result = tr_torrentParse(ctor, &info);
}
tr_metainfoFree(&info);
}
if (!fHandle && hashString) //backup - shouldn't be needed after upgrade to 1.70
if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
{
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
if (tr_torrentParse(ctor, &info) == TR_OK)
result = tr_torrentParse(ctor, &info);
}
if (result == TR_OK)
{
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
? fIncompleteFolder : fDownloadFolder;
@ -1661,8 +1657,8 @@ int trashDataFile(const char * filename)
fHandle = tr_torrentNew(ctor, NULL);
}
if (result != TR_EINVALID)
tr_metainfoFree(&info);
}
tr_ctorFree(ctor);