Fix 600MHz issue on power kernels
[qcpufreq] / src / mainwindow.cpp
index 5b0193a..518c7e1 100644 (file)
@@ -54,12 +54,11 @@ MainWindow::MainWindow(QWidget *parent) :
     settings = new Settings;
     settings->hide();
 
+    init();
+
     //applies the settings from the settings dialog
     applySettings();
 
-    init();
-    refresh();
-
     //initialize orientation
     orientationChanged();
 
@@ -133,6 +132,12 @@ void MainWindow::adjustFreq()
     }
     #endif
 
+    //check for 599MHz <-> 600MHz problem on power kernels
+    if (max == "600000" && settings->usePowerKernel()) {
+        //we really need to set the maximum to 599MHz
+        max = "599000";
+    }
+
     callHelper( "set_maxfreq", max );
 
     refresh();
@@ -146,6 +151,9 @@ void MainWindow::applySettings()
 {
     setAutoRotation();
     setAdvancedTemperature();
+
+    //refresh the GUI after applying the settings
+    refresh();
 }