+ /* The next few lines of code check if QCPUFreq is running on a power kernel.
+ * Basically we get the maximum available frequency - if it is greater than
+ * DEFAULT_FREQUENCY we can be sure that the current kernel is a power kernel.
+ */
+ QFile file( "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies" );
+
+ //open the file
+ if ( !file.exists() || !file.open( QIODevice::ReadOnly ) ) {
+ QMessageBox::critical(this, tr("QCPUFreq"), tr("Could not get information from /sys!"));
+ powerKernel = false;
+ } else {
+ //read the file
+ QTextStream in( &file );
+ QStringList freqList = in.readLine().split(" ");
+ int maxFreq = freqList.at(0).toInt();
+
+ //close the file
+ file.close();
+
+ if (maxFreq > DEFAULT_FREQUENCY) {
+ powerKernel = true;
+ } else {
+ powerKernel = false;
+ }
+ }
+
+ //on non-power-kernels we can disable the overclocking and temperature options
+ if (!powerKernel) {
+ ui->checkBox_oc->setDisabled(true);
+ ui->checkBox_temperature->setDisabled(true);
+ }
+