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

List:       kde-commits
Subject:    [kde-workspace/KDE/4.10] plasma/generic/applets/batterymonitor/contents/ui: fix #316213 - battery
From:       Lukáš Tinkl <lukas () kde ! org>
Date:       2013-04-09 16:19:57
Message-ID: 20130409161957.AC760A605E () git ! kde ! org
[Download RAW message or body]

Git commit 3e9f349f5eef146ded11affd6a98c3b1c1e44510 by Lukáš Tinkl.
Committed on 09/04/2013 at 18:18.
Pushed by lukas into branch 'KDE/4.10'.

fix #316213 - battery applet shows no battery after suspend w/o battery

BUG: 316213

M  +14   -2    plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml

http://commits.kde.org/kde-workspace/3e9f349f5eef146ded11affd6a98c3b1c1e44510

diff --git a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml \
b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml index \
                fedce02..8fe0aba 100644
--- a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
+++ b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
@@ -153,6 +153,17 @@ Item {
             Logic.updateTooltip();
             Logic.updateBrightness();
         }
+        onSourceAdded: {
+            if (source == "Battery0") {
+		disconnectSource(source);
+                connectSource(source);
+            }
+        }
+        onSourceRemoved: {
+            if (source == "Battery0") {
+                disconnectSource(source);
+            }
+        }
     }
 
     property QtObject batteries: PlasmaCore.DataModel {
@@ -190,8 +201,9 @@ Item {
         percent: batteries.cumulativePercent
         pluggedIn: pmSource.data["AC Adapter"]["Plugged in"]
         remainingMsec: parent.show_remaining_time ? \
                Number(pmSource.data["Battery"]["Remaining msec"]) : 0
-        showSuspendButton: Platform.shouldOfferSuspend(pmSource)
-        showHibernateButton: Platform.shouldOfferHibernate(pmSource)
+        showHybridSuspendButton: Platform.shouldOfferHybridSuspend(pmSource)
+        showSuspendButton: showHybridSuspendButton ? false : \
Platform.shouldOfferSuspend(pmSource) +        showHibernateButton: \
showHybridSuspendButton ? false : Platform.shouldOfferHibernate(pmSource)  
         onSuspendClicked: {
             plasmoid.togglePopup();


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

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