[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace/KDE/4.8] plasma/generic/applets/battery: The logic for the inhibition checkbox in the
From:       Dario Freddi <drf () kde ! org>
Date:       2012-01-20 14:00:23
Message-ID: 20120120140023.2926AA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 3919480e78c9b8854ce6e17f5ecbfbc009d40fef by Dario Freddi.
Committed on 20/01/2012 at 14:59.
Pushed by dafre into branch 'KDE/4.8'.

The logic for the inhibition checkbox in the plasma applet was inverted: fix that

M  +4    -2    plasma/generic/applets/battery/battery.cpp

http://commits.kde.org/kde-workspace/3919480e78c9b8854ce6e17f5ecbfbc009d40fef

diff --git a/plasma/generic/applets/battery/battery.cpp b/plasma/generic/applets/battery/battery.cpp
index 63d3673..854469d 100644
--- a/plasma/generic/applets/battery/battery.cpp
+++ b/plasma/generic/applets/battery/battery.cpp
@@ -1066,14 +1066,16 @@ void Battery::toggleInhibit(bool toggle)
 {
     using namespace Solid::PowerManagement;
 
-    if (m_inhibitCookies.first > 0 && m_inhibitCookies.second > 0 && !toggle) {
+    if (m_inhibitCookies.first > 0 && m_inhibitCookies.second > 0 && toggle) {
         // Release inhibition
+        kDebug() << "Releasing inhibition";
         stopSuppressingSleep(m_inhibitCookies.first);
         stopSuppressingScreenPowerManagement(m_inhibitCookies.second);
 
         m_inhibitCookies = qMakePair< int, int >(-1, -1);
-    } else if (m_inhibitCookies.first < 0 && m_inhibitCookies.second < 0 && toggle) {
+    } else if (m_inhibitCookies.first < 0 && m_inhibitCookies.second < 0 && !toggle) {
         // Trigger inhibition
+        kDebug() << "Trigger inhibition";
         QString reason = i18n("The battery applet has enabled system-wide inhibition");
         m_inhibitCookies = qMakePair< int, int >(beginSuppressingSleep(reason),
                                                  beginSuppressingScreenPowerManagement(reason));
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic