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

List:       kde-commits
Subject:    [powerdevil] daemon: Don't force reload profile when battery status changes
From:       Weng Xuetian <wengxt () gmail ! com>
Date:       2016-02-23 23:02:44
Message-ID: E1aYLye-000198-Pl () scm ! kde ! org
[Download RAW message or body]

Git commit f5449a05a6e7fda8a00ace21bc7401ed33712a80 by Weng Xuetian.
Committed on 23/02/2016 at 22:57.
Pushed by xuetianweng into branch 'master'.

Don't force reload profile when battery status changes

using refreshStatus is not necessary for such use cases, loadProfile
would be enough, otherwise it may reset status under certain
circumstances. For example, it is possible that battery discharges under
heavy load even when AC plugged for some laptop models. When this
happens, the AC profile will be forced reloaded again and again thus
brightness level is also being reset to the profile level.

REVIEW: 127160

M  +2    -2    daemon/powerdevilcore.cpp

http://commits.kde.org/powerdevil/f5449a05a6e7fda8a00ace21bc7401ed33712a80

diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
index 3630541..f02d474 100644
--- a/daemon/powerdevilcore.cpp
+++ b/daemon/powerdevilcore.cpp
@@ -569,7 +569,7 @@ void Core::onBatteryChargePercentChanged(int percent, const \
QString &udi)  if (currentPercent < previousPercent) {
         if (emitBatteryChargePercentNotification(currentPercent, previousPercent)) {
             // Only refresh status if a notification has actually been emitted
-            refreshStatus();
+            loadProfile();
         }
     }
 }
@@ -600,7 +600,7 @@ void Core::onBatteryChargeStateChanged(int state, const QString \
&udi)  
     if (!previousCharged && currentCharged) {
         emitRichNotification("fullbattery", i18n("Charge Complete"), i18n("Your \
                battery is now fully charged."));
-        refreshStatus();
+        loadProfile();
     }
 }
 


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

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