summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp4
-rw-r--r--libopie/odevice.cpp8
-rw-r--r--libopie/odevice.h5
3 files changed, 8 insertions, 9 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 68c2929..eda0c1f 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -61,25 +61,25 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
CalibrateLightSensor-> hide ( );
auto_brightness_ac-> hide ( );
CalibrateLightSensor_ac-> hide ( );
}
if (m_cres) {
GroupLight->setTitle(tr("Backlight && Contrast"));
GroupLight_ac->setTitle(GroupLight->title());
} else {
contrast->hide();
contrast_ac->hide();
}
- QStrList freq = ODevice::inst()->cpuFrequencies();
+ QStrList freq = ODevice::inst()->allowedCpuFrequencies();
if ( freq.count() ) {
frequency->insertStrList( freq );
frequency_ac->insertStrList( freq );
} else {
frequency->hide();
frequency_ac->hide();
}
Config config ( "apm" );
config. setGroup ( "Battery" );
// battery spinboxes
@@ -201,25 +201,25 @@ void LightSettings::setBacklight ( int bright )
}
void LightSettings::setContrast ( int contr )
{
if (contr == -1) contr = m_oldcontrast;
ODevice::inst ( )-> setDisplayContrast(contr);
}
void LightSettings::setFrequency ( int index )
{
qWarning("LightSettings::setFrequency(%d)", index);
- ODevice::inst ( )-> setCpuFrequency(index);
+ ODevice::inst ( )-> setCurrentCpuFrequency(index);
}
void LightSettings::resetBacklight ( )
{
setBacklight ( -1 );
setContrast ( -1 );
}
void LightSettings::accept ( )
{
Config config ( "apm" );
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 4c33a0e..d6e6892 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -766,38 +766,38 @@ int ODevice::readLightSensor ( )
return -1;
}
/**
* @return the light sensor resolution whatever that is ;)
*/
int ODevice::lightSensorResolution ( ) const
{
return 0;
}
/**
- * @return a list with valid CPU frequency
+ * @return a list with CPU frequencies supported by the hardware
*/
-QStrList &ODevice::cpuFrequencies ( ) const
+const QStrList &ODevice::allowedCpuFrequencies ( ) const
{
return *d->m_cpu_frequencies;
}
/**
- * Set desired cpu frequency
+ * Set desired CPU frequency
*
* @param index index into d->m_cpu_frequencies of the frequency to be set
*/
-bool ODevice::setCpuFrequency(uint index)
+bool ODevice::setCurrentCpuFrequency(uint index)
{
if (index >= d->m_cpu_frequencies->count())
return false;
char *freq = d->m_cpu_frequencies->at(index);
qWarning("set freq to %s", freq);
int fd;
if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) {
char writeCommand[50];
const int count = sprintf(writeCommand, "%s\n", freq);
diff --git a/libopie/odevice.h b/libopie/odevice.h
index 18ff5f1..f2f6467 100644
--- a/libopie/odevice.h
+++ b/libopie/odevice.h
@@ -189,27 +189,26 @@ public:
virtual void keySound ( );
virtual void touchSound ( );
virtual QValueList <OLed> ledList ( ) const;
virtual QValueList <OLedState> ledStateList ( OLed led ) const;
virtual OLedState ledState ( OLed led ) const;
virtual bool setLedState ( OLed led, OLedState st );
virtual bool hasLightSensor ( ) const;
virtual int readLightSensor ( );
virtual int lightSensorResolution ( ) const;
- QStrList &cpuFrequencies() const;
- bool setCpuFrequency(uint index);
- int cpuFrequency() const;
+ const QStrList &allowedCpuFrequencies() const;
+ bool setCurrentCpuFrequency(uint index);
/**
* Returns the available buttons on this device. The number and location
* of buttons will vary depending on the device. Button numbers will be assigned
* by the device manufacturer and will be from most preferred button to least preffered
* button. Note that this list only contains "user mappable" buttons.
*/
const QValueList<ODeviceButton> &buttons ( );
/**
* Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it
* returns 0L