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

List:       kde-commits
Subject:    kdenonbeta/kbatterymonitor/linux-acpi
From:       Chris Howells <howells () kde ! org>
Date:       2004-11-14 23:19:37
Message-ID: 20041114231937.2ADF516E7C () office ! kde ! org
[Download RAW message or body]

CVS commit by howells: 

Assume that polling /proc isn't an issue and constantly re-read the "static" battery information.


  M +12 -2     linux_acpi.cpp   1.13


--- kdenonbeta/kbatterymonitor/linux-acpi/linux_acpi.cpp  #1.12:1.13
@@ -97,11 +97,21 @@ int LinuxACPI::numberOfBatteries()
 batteryStatusStruct LinuxACPI::batteryStatus(int /*batteryNumber*/)
 {
+        // On Some older ACPI implementation there used to be major problems when polling /proc
+        // frequently so on those it would be better not to read the battery information since
+        // this PROBABLY won't change. Except it does change for me. Since I own a 5 hour
+        // and a 1.5 hour battery, and if I swap the batteries around, I get silly values being
+        // read. Basically waiting for some feedback to decide whether we should polling /proc
+        // is still an issue
+        
         // Every 5000 times we'll re-read the static battery information just in case it's changed
-        ++staticTimesRead;
+        /*++staticTimesRead;
         if (staticTimesRead == 5000)
         {
                 readStaticBatteryInformation(mBatteryInfoFile);
                 staticTimesRead = 0;
-        }
+        }*/
+
+        // Assume polling /proc isn't an issue
+        readStaticBatteryInformation(mBatteryInfoFile);
 
         readDynamicBatteryInformation(mBatteryStateFile);


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

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