From 1c2a7359afcb7353174e065d8c5010ddc9bf5dd0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 21 Oct 2010 20:04:00 +0000 Subject: [PATCH] (trunk gtk) "hibernation inhibition broke in transmission-2.00" -- fixed. --- gtk/tr-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 2a3176fac..369af1c9b 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -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 ); } /** -- 2.40.0