summaryrefslogtreecommitdiff
path: root/libopie2
authoralwin <alwin>2005-03-12 14:16:28 (UTC)
committer alwin <alwin>2005-03-12 14:16:28 (UTC)
commitced8831cd48879e33fa11d45035cc7ff94180897 (patch) (unidiff)
treeeba728c5df05e98e8c381baeea7e13bc1600b15d /libopie2
parentaa7039012cc79c02304e36db16e6f5ff82e19867 (diff)
downloadopie-ced8831cd48879e33fa11d45035cc7ff94180897.zip
opie-ced8831cd48879e33fa11d45035cc7ff94180897.tar.gz
opie-ced8831cd48879e33fa11d45035cc7ff94180897.tar.bz2
this error will get my personal "error of the month":
due different declarations of "readHingeSensors" (const vs. non-const) rotate-applet always got the default-implementation -> CASE_UNKNOWN. (device vs. device_zaurus). Setting it to "const" (which makes sense) let rotateapplet set light of or suspend or whatever user defined when case is closed.
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp2
-rw-r--r--libopie2/opiecore/device/odevice.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index ed705a6..cf2061b 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -486,65 +486,65 @@ bool ODevice::setLedState ( OLed which, OLedState st )
486bool ODevice::hasLightSensor() const 486bool ODevice::hasLightSensor() const
487{ 487{
488 return false; 488 return false;
489} 489}
490 490
491/** 491/**
492* @return a value from the light sensor 492* @return a value from the light sensor
493*/ 493*/
494int ODevice::readLightSensor() 494int ODevice::readLightSensor()
495{ 495{
496 return -1; 496 return -1;
497} 497}
498 498
499/** 499/**
500* @return the light sensor resolution 500* @return the light sensor resolution
501*/ 501*/
502int ODevice::lightSensorResolution() const 502int ODevice::lightSensorResolution() const
503{ 503{
504 return 0; 504 return 0;
505} 505}
506 506
507/** 507/**
508* @return if the device has a hinge sensor 508* @return if the device has a hinge sensor
509*/ 509*/
510bool ODevice::hasHingeSensor() const 510bool ODevice::hasHingeSensor() const
511{ 511{
512 return false; 512 return false;
513} 513}
514 514
515/** 515/**
516* @return a value from the hinge sensor 516* @return a value from the hinge sensor
517*/ 517*/
518OHingeStatus ODevice::readHingeSensor() 518OHingeStatus ODevice::readHingeSensor()const
519{ 519{
520 return CASE_UNKNOWN; 520 return CASE_UNKNOWN;
521} 521}
522 522
523/** 523/**
524* @return a list with CPU frequencies supported by the hardware 524* @return a list with CPU frequencies supported by the hardware
525*/ 525*/
526const QStrList &ODevice::allowedCpuFrequencies() const 526const QStrList &ODevice::allowedCpuFrequencies() const
527{ 527{
528 return *d->m_cpu_frequencies; 528 return *d->m_cpu_frequencies;
529} 529}
530 530
531 531
532/** 532/**
533* Set desired CPU frequency 533* Set desired CPU frequency
534* 534*
535* @param index index into d->m_cpu_frequencies of the frequency to be set 535* @param index index into d->m_cpu_frequencies of the frequency to be set
536*/ 536*/
537bool ODevice::setCurrentCpuFrequency(uint index) 537bool ODevice::setCurrentCpuFrequency(uint index)
538{ 538{
539 if (index >= d->m_cpu_frequencies->count()) 539 if (index >= d->m_cpu_frequencies->count())
540 return false; 540 return false;
541 541
542 char *freq = d->m_cpu_frequencies->at(index); 542 char *freq = d->m_cpu_frequencies->at(index);
543 qWarning("set freq to %s", freq); 543 qWarning("set freq to %s", freq);
544 544
545 int fd; 545 int fd;
546 546
547 if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) { 547 if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) {
548 char writeCommand[50]; 548 char writeCommand[50];
549 const int count = sprintf(writeCommand, "%s\n", freq); 549 const int count = sprintf(writeCommand, "%s\n", freq);
550 int res = (::write(fd, writeCommand, count) != -1); 550 int res = (::write(fd, writeCommand, count) != -1);
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index c434216..e7cd82a 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -256,65 +256,65 @@ public:
256 virtual ODirection direction() const; 256 virtual ODirection direction() const;
257 257
258 // system 258 // system
259 virtual bool suspend(); 259 virtual bool suspend();
260 260
261 virtual bool setDisplayStatus ( bool on ); 261 virtual bool setDisplayStatus ( bool on );
262 virtual bool setDisplayBrightness ( int brightness ); 262 virtual bool setDisplayBrightness ( int brightness );
263 virtual int displayBrightnessResolution() const; 263 virtual int displayBrightnessResolution() const;
264 virtual bool setDisplayContrast ( int contrast ); 264 virtual bool setDisplayContrast ( int contrast );
265 virtual int displayContrastResolution() const; 265 virtual int displayContrastResolution() const;
266 266
267 // don't add new virtual methods, use this: 267 // don't add new virtual methods, use this:
268 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; 268 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
269 // and in your subclass do overwrite 269 // and in your subclass do overwrite
270 // protected virtual int virtual_hook(int, void *) 270 // protected virtual int virtual_hook(int, void *)
271 // which is defined below 271 // which is defined below
272 272
273 // input / output 273 // input / output
274 virtual void playAlarmSound(); 274 virtual void playAlarmSound();
275 virtual void playKeySound(); 275 virtual void playKeySound();
276 virtual void playTouchSound(); 276 virtual void playTouchSound();
277 277
278 virtual QValueList <OLed> ledList() const; 278 virtual QValueList <OLed> ledList() const;
279 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 279 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
280 virtual OLedState ledState ( OLed led ) const; 280 virtual OLedState ledState ( OLed led ) const;
281 virtual bool setLedState ( OLed led, OLedState st ); 281 virtual bool setLedState ( OLed led, OLedState st );
282 282
283 virtual bool hasLightSensor() const; 283 virtual bool hasLightSensor() const;
284 virtual int readLightSensor(); 284 virtual int readLightSensor();
285 virtual int lightSensorResolution() const; 285 virtual int lightSensorResolution() const;
286 286
287 virtual bool hasHingeSensor() const; 287 virtual bool hasHingeSensor() const;
288 virtual OHingeStatus readHingeSensor(); 288 virtual OHingeStatus readHingeSensor()const;
289 289
290 const QStrList &allowedCpuFrequencies() const; 290 const QStrList &allowedCpuFrequencies() const;
291 bool setCurrentCpuFrequency(uint index); 291 bool setCurrentCpuFrequency(uint index);
292 292
293 /** 293 /**
294 * Returns the available buttons on this device. The number and location 294 * Returns the available buttons on this device. The number and location
295 * of buttons will vary depending on the device. Button numbers will be assigned 295 * of buttons will vary depending on the device. Button numbers will be assigned
296 * by the device manufacturer and will be from most preferred button to least preffered 296 * by the device manufacturer and will be from most preferred button to least preffered
297 * button. Note that this list only contains "user mappable" buttons. 297 * button. Note that this list only contains "user mappable" buttons.
298 * 298 *
299 * @todo Make method const and take care of calling initButtons or make that const too 299 * @todo Make method const and take care of calling initButtons or make that const too
300 * 300 *
301 */ 301 */
302 const QValueList<ODeviceButton> &buttons(); 302 const QValueList<ODeviceButton> &buttons();
303 303
304 /** 304 /**
305 * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it 305 * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it
306 * returns 0L 306 * returns 0L
307 */ 307 */
308 const ODeviceButton *buttonForKeycode ( ushort keyCode ); 308 const ODeviceButton *buttonForKeycode ( ushort keyCode );
309 309
310 /** 310 /**
311 * Reassigns the pressed action for \a button. To return to the factory 311 * Reassigns the pressed action for \a button. To return to the factory
312 * default pass an empty string as \a qcopMessage. 312 * default pass an empty string as \a qcopMessage.
313 */ 313 */
314 void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); 314 void remapPressedAction ( int button, const OQCopMessage &qcopMessage );
315 315
316 /** 316 /**
317 * Reassigns the held action for \a button. To return to the factory 317 * Reassigns the held action for \a button. To return to the factory
318 * default pass an empty string as \a qcopMessage. 318 * default pass an empty string as \a qcopMessage.
319 */ 319 */
320 void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); 320 void remapHeldAction ( int button, const OQCopMessage &qcopMessage );