1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

cleanup last commit(s)

This commit is contained in:
Mitchell Livingston 2009-05-22 02:52:28 +00:00
parent c36a007cd4
commit 0b7007088b

View file

@ -1592,7 +1592,6 @@ int trashDataFile(const char * filename)
@implementation Torrent (Private)
//if a hash is given, attempt to load that; otherwise, attempt to open file at path
- (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
publicTorrent: (NSNumber *) publicTorrent
downloadFolder: (NSString *) downloadFolder
@ -1636,29 +1635,30 @@ int trashDataFile(const char * filename)
tr_ctorSetPaused(ctor, TR_FORCE, YES);
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
tr_info info;
int result = TR_EINVALID;
if (path)
{
tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
result = tr_torrentParse(ctor, &info);
}
if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
{
result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
//backup - shouldn't be needed after upgrade to 1.62
if (result != TR_OK && hashString)
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
result = tr_torrentParse(ctor, &info);
}
if (result == TR_OK)
{
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
? fIncompleteFolder : fDownloadFolder;
tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
tr_info info;
result = tr_torrentParse(ctor, &info);
fHandle = tr_torrentNew(ctor, NULL);
if (result == TR_OK)
{
NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]
? fIncompleteFolder : fDownloadFolder;
tr_ctorSetDownloadDir(ctor, TR_FORCE, [currentDownloadFolder UTF8String]);
fHandle = tr_torrentNew(ctor, NULL);
}
if (result != TR_EINVALID)
tr_metainfoFree(&info);
}
if (result != TR_EINVALID)
tr_metainfoFree(&info);
tr_ctorFree(ctor);