summaryrefslogtreecommitdiffstats
path: root/src/hardware_cpu.cpp
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-18 12:32:26 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-18 12:32:26 +0000
commita50cc3d292ae7d0867ac69515ffc6a158ef7883b (patch)
tree2aa9527bb566c744ca734d0a52e228329c8abb41 /src/hardware_cpu.cpp
parentce95d7052be28df7af07a659e8751b6e961f31ce (diff)
downloadtdepowersave-a50cc3d292ae7d0867ac69515ffc6a158ef7883b.tar.gz
tdepowersave-a50cc3d292ae7d0867ac69515ffc6a158ef7883b.zip
[applications/kpowersave] make compatible with QT_NO_ASCII_CAST flag
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpowersave@1215362 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/hardware_cpu.cpp')
-rw-r--r--src/hardware_cpu.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hardware_cpu.cpp b/src/hardware_cpu.cpp
index c05e3ec..f0d939c 100644
--- a/src/hardware_cpu.cpp
+++ b/src/hardware_cpu.cpp
@@ -38,6 +38,7 @@
// system header
#include <fcntl.h>
+#include <unistd.h>
/*! The default constructor of the class CPUInfo */
CPUInfo::CPUInfo() {
@@ -123,7 +124,7 @@ int CPUInfo::checkCPUSpeed(){
new_value = -1;
- fd = open(cpu_device, O_RDONLY);
+ fd = open(cpu_device.ascii(), O_RDONLY);
if (read(fd, buf, 14) > 0){
new_value = strtol(buf, NULL, 10)/1000;
close(fd);
@@ -295,7 +296,7 @@ void CPUInfo::getCPUMaxSpeed() {
// while (!access(cpu_device_max, R_OK)) {
for (int cpu_id=0; cpu_id < numOfCPUs; cpu_id++) {
- fd = open(cpu_device_max, O_RDONLY);
+ fd = open(cpu_device_max.ascii(), O_RDONLY);
if (read(fd, buf, 14) > 0){
maxfreq = strtol(buf, NULL, 10)/1000;
cpufreq_max_speed.append(maxfreq);