mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
(trunk) fix gtk bug of not remembering users' settings for per-torrent peer limits
This commit is contained in:
parent
4f9ae41046
commit
a9f8c517a0
3 changed files with 22 additions and 0 deletions
|
@ -588,6 +588,11 @@ prefsChanged( TrCore * core,
|
|||
const uint16_t val = pref_int_get( key );
|
||||
tr_sessionSetPeerLimit( tr_core_session( core ), val );
|
||||
}
|
||||
else if( !strcmp( key, TR_PREFS_KEY_PEER_LIMIT_TORRENT ) )
|
||||
{
|
||||
const uint16_t val = pref_int_get( key );
|
||||
tr_sessionSetPeerLimitPerTorrent( tr_core_session( core ), val );
|
||||
}
|
||||
else if( !strcmp( key, PREF_KEY_INHIBIT_HIBERNATION ) )
|
||||
{
|
||||
maybeInhibitHibernation( core );
|
||||
|
|
|
@ -710,6 +710,18 @@ tr_sessionGetPeerLimit( const tr_session * session UNUSED )
|
|||
return tr_fdGetPeerLimit( );
|
||||
}
|
||||
|
||||
void
|
||||
tr_sessionSetPeerLimitPerTorrent( tr_session * session, uint16_t n )
|
||||
{
|
||||
session->peerLimitPerTorrent = n;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
tr_sessionGetPeerLimitPerTorrent( const tr_session * session )
|
||||
{
|
||||
return session->peerLimitPerTorrent;
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
|
|
@ -538,6 +538,11 @@ void tr_sessionSetPeerLimit( tr_session * session,
|
|||
|
||||
uint16_t tr_sessionGetPeerLimit( const tr_session * session );
|
||||
|
||||
void tr_sessionSetPeerLimitPerTorrent( tr_session * session,
|
||||
uint16_t maxGlobalPeers );
|
||||
|
||||
uint16_t tr_sessionGetPeerLimitPerTorrent( const tr_session * session );
|
||||
|
||||
|
||||
/**
|
||||
* Load all the torrents in tr_getTorrentDir().
|
||||
|
|
Loading…
Reference in a new issue