+ * Calls the QCPUFreq helper script with "sudo action param"
+ *
+ * @param action : the action of the helper script
+ * @param param : the parameter for the action
+ * @return exit code
+ */
+int MainWindow::callHelper(QString action, QString param)
+{
+ QStringList arguments;
+
+ #if defined(Q_WS_MAEMO_5)
+ //On Maemo 5 the helper script resides in /opt/usr/bin, which is usually not in $PATH
+ arguments.append( "/opt/usr/bin/QCPUFreq.helper" );
+ #else
+ arguments.append( "QCPUFreq.helper" );
+ #endif
+
+ arguments.append( action );
+ arguments.append( param );
+
+ helperProcess.start( "sudo", arguments, QIODevice::NotOpen );
+
+ if ( showSudoError && !helperProcess.waitForFinished( 400 )) {
+ //do not show this error again
+ showSudoError = false;
+ QMessageBox::critical(this, tr("QCPUFreq"), tr("There seems to be a problem with your sudo setup!"));
+ }
+
+ return helperProcess.exitCode();
+}
+
+
+/**
+ * Returns the current CPU temperature
+ */
+QString MainWindow::getCPUTemp()
+{
+#if defined(Q_WS_MAEMO_5)
+ 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" ) + " " + 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.
+ */
+ readSysFile( "devices/platform/omap34xx_temp/temp1_input" );
+
+ //read the current system temperature
+ QString tstring = readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
+ if (tstring == "0")
+ return tr( "Unknown" );
+
+ //convert it to an integer and calculate the approx. temperature from the raw value
+ int tint = tstring.toInt();
+ tint = ( 0.65 * tint );
+ tstring.setNum(tint);
+ return QString( tstring + " " + QString::fromUtf8("\302\260") + "C" );
+ }
+#endif
+ return tr( "Unknown" );
+}
+
+
+/**