projects
/
qcpufreq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b7509c7
)
Read more accurate temperature on power kernels
author
Daniel Klaffenbach
<danielklaffenbach@gmail.com>
Mon, 28 Jun 2010 21:14:03 +0000
(23:14 +0200)
committer
Daniel Klaffenbach
<danielklaffenbach@gmail.com>
Mon, 28 Jun 2010 21:14:03 +0000
(23:14 +0200)
src/mainwindow.cpp
patch
|
blob
|
history
diff --git
a/src/mainwindow.cpp
b/src/mainwindow.cpp
index
201e005
..
712a50e
100755
(executable)
--- a/
src/mainwindow.cpp
+++ b/
src/mainwindow.cpp
@@
-152,7
+152,13
@@
int MainWindow::callHelper(QString action, QString param)
QString MainWindow::getCPUTemp()
{
#if defined(Q_WS_MAEMO_5)
QString MainWindow::getCPUTemp()
{
#if defined(Q_WS_MAEMO_5)
- return readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
+ QFile file( "/sys/class/power_supply/bq27200-0/temp" );
+
+ //check if we can read a more accurate temperature (only for power kernel)
+ if (file.exists())
+ return QString( readSysFile( "class/power_supply/bq27200-0/temp" ) + " °C" );
+ else
+ return readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
#endif
return tr( "Unknown" );
}
#endif
return tr( "Unknown" );
}
@@
-276,6
+282,9
@@
QString MainWindow::readSysFile(QString sys_file)
QTextStream in( &file );
QString txt = in.readLine();
QTextStream in( &file );
QString txt = in.readLine();
+ //close the file
+ file.close();
+
return txt;
}
return txt;
}