1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 05:22:40 +00:00

eliminate redundant code

This commit is contained in:
Mitchell Livingston 2009-12-13 01:40:53 +00:00
parent 09442cd88b
commit 5f82580e30

View file

@ -1542,27 +1542,6 @@ int trashDataFile(const char * filename)
if (torrentStruct)
fHandle = torrentStruct;
else if (magnetAddress)
{
tr_ctor * ctor = tr_ctorNew(lib);
tr_ctorSetPaused(ctor, TR_FORCE, YES);
if (downloadFolder)
tr_ctorSetDownloadDir(ctor, TR_FORCE, [downloadFolder UTF8String]);
const tr_parse_result result = tr_ctorSetMagnet(ctor, [magnetAddress UTF8String]);
if (result == TR_PARSE_OK)
fHandle = tr_torrentNew(ctor, NULL);
tr_ctorFree(ctor);
if (!fHandle)
{
[self release];
return nil;
}
}
else
{
//set libtransmission settings for initialization
@ -1578,6 +1557,9 @@ int trashDataFile(const char * filename)
if (path)
result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
if (result != TR_PARSE_OK && magnetAddress)
result = tr_ctorSetMagnet(ctor, [magnetAddress UTF8String]);
//backup - shouldn't be needed after upgrade to 1.70
if (result != TR_PARSE_OK && hashString)
result = tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);