]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) "hibernation inhibition broke in transmission-2.00" -- fixed.
authorCharles Kerr <charles@transmissionbt.com>
Thu, 21 Oct 2010 20:04:00 +0000 (20:04 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Thu, 21 Oct 2010 20:04:00 +0000 (20:04 +0000)
gtk/tr-core.c

index 2a3176facfeda6404a403336f94abec2412e9e0d..369af1c9b3e47a0765f870f0e74346cd8cd9d191 100644 (file)
@@ -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 );
 }
 
 /**