mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
(trunk gtk) "hibernation inhibition broke in transmission-2.00" -- fixed.
This commit is contained in:
parent
571f6b8e07
commit
1c2a7359af
1 changed files with 7 additions and 5 deletions
|
@ -1420,6 +1420,7 @@ gtr_inhibit_hibernation( guint * cookie )
|
|||
G_TYPE_INVALID, /* sentinel - end of input args */
|
||||
G_TYPE_UINT, cookie,
|
||||
G_TYPE_INVALID /* senitnel - end of output args */ );
|
||||
|
||||
if( success )
|
||||
tr_inf( "%s", _( "Disallowing desktop hibernation" ) );
|
||||
else
|
||||
|
@ -1493,11 +1494,12 @@ tr_core_set_hibernation_allowed( TrCore * core,
|
|||
static void
|
||||
maybeInhibitHibernation( TrCore * core )
|
||||
{
|
||||
/* inhibit if it's enabled *AND* all the torrents are paused */
|
||||
const gboolean inhibit = pref_flag_get( PREF_KEY_INHIBIT_HIBERNATION )
|
||||
&& ( tr_core_get_active_torrent_count( core ) == 0 );
|
||||
|
||||
tr_core_set_hibernation_allowed( core, !inhibit );
|
||||
/* hibernation is allowed if EITHER
|
||||
* (a) the "inhibit" pref is turned off OR
|
||||
* (b) there aren't any active torrents */
|
||||
const gboolean hibernation_allowed = !pref_flag_get( PREF_KEY_INHIBIT_HIBERNATION )
|
||||
|| !tr_core_get_active_torrent_count( core );
|
||||
tr_core_set_hibernation_allowed( core, hibernation_allowed );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue