1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 18:25:35 +00:00

(gtk) #1355: transmission blocks hibernation when torrents are paused

This commit is contained in:
Charles Kerr 2008-10-20 16:22:33 +00:00
parent 9d7ef3bf38
commit f18c4fbbaf

View file

@ -1179,13 +1179,15 @@ maybeInhibitHibernation( TrCore * core )
{
gboolean inhibit = pref_flag_get( PREF_KEY_INHIBIT_HIBERNATION );
if( inhibit )
{
/* don't inhibit if we've got active torrents */
/* always allow hibernation when all the torrents are paused */
if( inhibit ) {
gboolean active = FALSE;
tr_handle * session = tr_core_handle( core );
tr_torrent * tor = NULL;
while(( tor = tr_torrentNext( session, tor )))
if( tr_torrentGetStatus( tor ) != TR_STATUS_STOPPED )
if(( active = ( tr_torrentGetStatus( tor ) != TR_STATUS_STOPPED )))
break;
if( !active )
inhibit = FALSE;
}