projects
/
qcpufreq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New release: 0.4.4
[qcpufreq]
/
src
/
mainwindow.cpp
diff --git
a/src/mainwindow.cpp
b/src/mainwindow.cpp
index
cf21237
..
cb396ca
100644
(file)
--- a/
src/mainwindow.cpp
+++ b/
src/mainwindow.cpp
@@
-1,6
+1,6
@@
/*
* QCPUFreq - a simple cpufreq GUI
/*
* QCPUFreq - a simple cpufreq GUI
- * Copyright (C) 2010 Daniel Klaffenbach <danielklaffenbach@gmail.com>
+ * Copyright (C) 2010-11 Daniel Klaffenbach <danielklaffenbach@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-28,7
+28,7
@@
#endif
#define APPNAME "QCPUFreq"
#endif
#define APPNAME "QCPUFreq"
-#define APPVERSION "0.4.2"
+#define APPVERSION "0.4.4"
MainWindow::MainWindow(QWidget *parent) :
MainWindow::MainWindow(QWidget *parent) :
@@
-117,7
+117,7
@@
MainWindow::~MainWindow()
*/
void MainWindow::about()
{
*/
void MainWindow::about()
{
- QMessageBox::about(this, APPNAME " " APPVERSION, "<p style=\"align:center;\">© 2010 Daniel Klaffenbach</p>" );
+ QMessageBox::about(this, APPNAME " " APPVERSION, "<p style=\"align:center;\">© 2011 Daniel Klaffenbach</p>" );
refresh();
}
refresh();
}
@@
-159,7
+159,9
@@
void MainWindow::adjustFreq()
if (settings->useConfirmation()) {
QMessageBox box;
if (settings->useConfirmation()) {
QMessageBox box;
- box.setAttribute(Qt::WA_Maemo5AutoOrientation, settings->useAutoRotate());
+ #if defined(Q_WS_MAEMO_5)
+ box.setAttribute(Qt::WA_Maemo5AutoOrientation, settings->useAutoRotate());
+ #endif
box.setStandardButtons(QMessageBox::Apply | QMessageBox::Cancel);
box.setDefaultButton(QMessageBox::Apply);
box.setIcon(QMessageBox::Question);
box.setStandardButtons(QMessageBox::Apply | QMessageBox::Cancel);
box.setDefaultButton(QMessageBox::Apply);
box.setIcon(QMessageBox::Question);
@@
-281,11
+283,15
@@
QString MainWindow::getCPUTemp()
{
#if defined(Q_WS_MAEMO_5)
QFile file( "/sys/class/power_supply/bq27200-0/temp" );
{
#if defined(Q_WS_MAEMO_5)
QFile file( "/sys/class/power_supply/bq27200-0/temp" );
+ //! The string containing the value of the temperature
+ QString tstring;
//check if we can read a more accurate temperature (only for power kernel)
//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" ) + " " + QString::fromUtf8("\302\260") + "C" );
- else {
+ if (file.exists()) {
+ //this only works on kernel-power > 46
+ tstring = readSysFile( "class/power_supply/bq27200-0/temp" );
+ return tstring.left(tstring.length()-1) + " " + QString::fromUtf8("\302\260") + "C";
+ } else {
/*
We actually only need to read the raw temperature, but it appears that by also reading temp1_input
the raw temperature (temp1_input_raw) is being updated more frequently.
/*
We actually only need to read the raw temperature, but it appears that by also reading temp1_input
the raw temperature (temp1_input_raw) is being updated more frequently.
@@
-293,7
+299,7
@@
QString MainWindow::getCPUTemp()
readSysFile( "devices/platform/omap34xx_temp/temp1_input" );
//read the current system temperature
readSysFile( "devices/platform/omap34xx_temp/temp1_input" );
//read the current system temperature
- QString tstring = readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
+ tstring = readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
if (tstring == "0")
return tr( "Unknown" );
if (tstring == "0")
return tr( "Unknown" );
@@
-417,7
+423,9
@@
void MainWindow::loadPreset(QString presetName)
{
#if defined(Q_WS_MAEMO_5)
callHelper("loadpreset", presetName);
{
#if defined(Q_WS_MAEMO_5)
callHelper("loadpreset", presetName);
+ calculateMinFreq();
QMaemo5InformationBox::information(this, tr( "The preset was loaded." ), QMaemo5InformationBox::DefaultTimeout);
QMaemo5InformationBox::information(this, tr( "The preset was loaded." ), QMaemo5InformationBox::DefaultTimeout);
+ refresh();
#endif
}
#endif
}