make libtransmission's pex accessor public, and eliminate a redundant variable in Torrent.[mh]
This commit is contained in:
parent
57eaa27970
commit
cc2db392f5
|
@ -61,8 +61,6 @@ void tr_torrentSetHasPiece( tr_torrent * tor, int pieceIndex, int has );
|
||||||
void tr_torrentLock ( const tr_torrent * );
|
void tr_torrentLock ( const tr_torrent * );
|
||||||
void tr_torrentUnlock ( const tr_torrent * );
|
void tr_torrentUnlock ( const tr_torrent * );
|
||||||
|
|
||||||
int tr_torrentIsPexEnabled( const tr_torrent * );
|
|
||||||
|
|
||||||
void tr_torrentChangeMyPort ( tr_torrent * );
|
void tr_torrentChangeMyPort ( tr_torrent * );
|
||||||
|
|
||||||
int tr_torrentExists( tr_handle *, const uint8_t * );
|
int tr_torrentExists( tr_handle *, const uint8_t * );
|
||||||
|
|
|
@ -403,6 +403,7 @@ tr_torrent * tr_torrentInitSaved( tr_handle *,
|
||||||
* disabled and cannot be enabled.
|
* disabled and cannot be enabled.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
void tr_torrentDisablePex( tr_torrent *, int disable );
|
void tr_torrentDisablePex( tr_torrent *, int disable );
|
||||||
|
int tr_torrentIsPexEnabled( const tr_torrent * );
|
||||||
|
|
||||||
const tr_info * tr_torrentInfo( const tr_torrent * );
|
const tr_info * tr_torrentInfo( const tr_torrent * );
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,6 @@ typedef enum
|
||||||
BOOL fPublicTorrent;
|
BOOL fPublicTorrent;
|
||||||
NSString * fPublicTorrentLocation;
|
NSString * fPublicTorrentLocation;
|
||||||
|
|
||||||
BOOL fPex;
|
|
||||||
|
|
||||||
NSUserDefaults * fDefaults;
|
NSUserDefaults * fDefaults;
|
||||||
|
|
||||||
NSImage * fIcon;
|
NSImage * fIcon;
|
||||||
|
@ -200,7 +198,7 @@ typedef enum
|
||||||
- (float) swarmSpeed;
|
- (float) swarmSpeed;
|
||||||
|
|
||||||
- (BOOL) pex;
|
- (BOOL) pex;
|
||||||
- (void) setPex: (BOOL) setting;
|
- (void) setPex: (BOOL) enabled;
|
||||||
|
|
||||||
- (NSNumber *) orderValue;
|
- (NSNumber *) orderValue;
|
||||||
- (void) setOrderValue: (int) orderValue;
|
- (void) setOrderValue: (int) orderValue;
|
||||||
|
|
|
@ -135,8 +135,9 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||||
if (fPublicTorrent)
|
if (fPublicTorrent)
|
||||||
[history setObject: [self publicTorrentLocation] forKey: @"TorrentPath"];
|
[history setObject: [self publicTorrentLocation] forKey: @"TorrentPath"];
|
||||||
|
|
||||||
|
#warning need?
|
||||||
if (![self privateTorrent])
|
if (![self privateTorrent])
|
||||||
[history setObject: [NSNumber numberWithBool: fPex] forKey: @"Pex"];
|
[history setObject: [NSNumber numberWithBool: [self pex]] forKey: @"Pex"];
|
||||||
|
|
||||||
if (fDateCompleted)
|
if (fDateCompleted)
|
||||||
[history setObject: fDateCompleted forKey: @"DateCompleted"];
|
[history setObject: fDateCompleted forKey: @"DateCompleted"];
|
||||||
|
@ -1130,16 +1131,12 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||||
|
|
||||||
- (BOOL) pex
|
- (BOOL) pex
|
||||||
{
|
{
|
||||||
return fPex;
|
return tr_torrentIsPexEnabled(fHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPex: (BOOL) setting
|
- (void) setPex: (BOOL) enabled
|
||||||
{
|
{
|
||||||
if (![self privateTorrent])
|
tr_torrentDisablePex(fHandle, !enabled);
|
||||||
{
|
|
||||||
fPex = setting;
|
|
||||||
tr_torrentDisablePex(fHandle, !setting);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSNumber *) orderValue
|
- (NSNumber *) orderValue
|
||||||
|
@ -1464,11 +1461,13 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||||
fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];
|
fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];
|
||||||
fFinishedSeeding = NO;
|
fFinishedSeeding = NO;
|
||||||
|
|
||||||
|
#warning need?
|
||||||
|
BOOL pexEnable;
|
||||||
if ([self privateTorrent])
|
if ([self privateTorrent])
|
||||||
fPex = NO;
|
pexEnable = NO;
|
||||||
else
|
else
|
||||||
fPex = pex ? [pex boolValue] : YES;
|
pexEnable = pex ? [pex boolValue] : YES;
|
||||||
tr_torrentDisablePex(fHandle, !fPex);
|
[self setPex: pexEnable];
|
||||||
|
|
||||||
fWaitToStart = waitToStart ? [waitToStart boolValue] : [fDefaults boolForKey: @"AutoStartDownload"];
|
fWaitToStart = waitToStart ? [waitToStart boolValue] : [fDefaults boolForKey: @"AutoStartDownload"];
|
||||||
fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
|
fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
|
||||||
|
|
Loading…
Reference in New Issue