mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
cleanup last commit(s)
This commit is contained in:
parent
c36a007cd4
commit
0b7007088b
1 changed files with 16 additions and 16 deletions
|
@ -1592,7 +1592,6 @@ int trashDataFile(const char * filename)
|
||||||
|
|
||||||
@implementation Torrent (Private)
|
@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
|
- (id) initWithPath: (NSString *) path hash: (NSString *) hashString torrentStruct: (tr_torrent *) torrentStruct lib: (tr_session *) lib
|
||||||
publicTorrent: (NSNumber *) publicTorrent
|
publicTorrent: (NSNumber *) publicTorrent
|
||||||
downloadFolder: (NSString *) downloadFolder
|
downloadFolder: (NSString *) downloadFolder
|
||||||
|
@ -1636,18 +1635,18 @@ int trashDataFile(const char * filename)
|
||||||
tr_ctorSetPaused(ctor, TR_FORCE, YES);
|
tr_ctorSetPaused(ctor, TR_FORCE, YES);
|
||||||
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
|
tr_ctorSetPeerLimit(ctor, TR_FALLBACK, [fDefaults integerForKey: @"PeersTorrent"]);
|
||||||
|
|
||||||
tr_info info;
|
|
||||||
int result = TR_EINVALID;
|
int result = TR_EINVALID;
|
||||||
if (path)
|
if (path)
|
||||||
{
|
result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
|
||||||
tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
|
|
||||||
result = tr_torrentParse(ctor, &info);
|
//backup - shouldn't be needed after upgrade to 1.62
|
||||||
}
|
if (result != TR_OK && hashString)
|
||||||
if (result != TR_OK && hashString) //backup - shouldn't be needed after upgrade to 1.70
|
|
||||||
{
|
|
||||||
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
|
tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);
|
||||||
|
|
||||||
|
if (result == TR_OK)
|
||||||
|
{
|
||||||
|
tr_info info;
|
||||||
result = tr_torrentParse(ctor, &info);
|
result = tr_torrentParse(ctor, &info);
|
||||||
}
|
|
||||||
|
|
||||||
if (result == TR_OK)
|
if (result == TR_OK)
|
||||||
{
|
{
|
||||||
|
@ -1659,6 +1658,7 @@ int trashDataFile(const char * filename)
|
||||||
}
|
}
|
||||||
if (result != TR_EINVALID)
|
if (result != TR_EINVALID)
|
||||||
tr_metainfoFree(&info);
|
tr_metainfoFree(&info);
|
||||||
|
}
|
||||||
|
|
||||||
tr_ctorFree(ctor);
|
tr_ctorFree(ctor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue