Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 82e127e..67dfa41 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -133,4 +133,8 @@ struct z_button z_buttons_c700 [] = { | |||
133 | void Zaurus::init(const QString& cpu_info) | 133 | void Zaurus::init(const QString& cpu_info) |
134 | { | 134 | { |
135 | // Set the time to wait until the system is realy suspended | ||
136 | // the delta between apm --suspend and sleeping | ||
137 | setAPMTimeOut( 15000 ); | ||
138 | |||
135 | // generic distribution code already scanned /etc/issue at that point - | 139 | // generic distribution code already scanned /etc/issue at that point - |
136 | // embedix releases contain "Embedix <version> | Linux for Embedded Devices" | 140 | // embedix releases contain "Embedix <version> | Linux for Embedded Devices" |
@@ -483,36 +487,4 @@ bool Zaurus::setDisplayStatus( bool on ) | |||
483 | } | 487 | } |
484 | 488 | ||
485 | bool Zaurus::suspend() | ||
486 | { | ||
487 | qDebug("ODevice::suspend"); | ||
488 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | ||
489 | return false; | ||
490 | |||
491 | if ( d->m_model == Model_Unknown ) // better don't suspend on unknown devices | ||
492 | return false; | ||
493 | |||
494 | bool res = false; | ||
495 | ODevice::sendSuspendmsg(); | ||
496 | |||
497 | struct timeval tvs, tvn; | ||
498 | ::gettimeofday ( &tvs, 0 ); | ||
499 | |||
500 | ::sync(); // flush fs caches | ||
501 | res = ( ::system ( "apm --suspend" ) == 0 ); | ||
502 | |||
503 | // This is needed because the apm implementation is asynchronous and we | ||
504 | // can not be sure when exactly the device is really suspended | ||
505 | if ( res ) { | ||
506 | do { // Yes, wait 15 seconds. This APM sucks big time. | ||
507 | ::usleep ( 200 * 1000 ); | ||
508 | ::gettimeofday ( &tvn, 0 ); | ||
509 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); | ||
510 | } | ||
511 | |||
512 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); | ||
513 | return res; | ||
514 | } | ||
515 | |||
516 | |||
517 | Transformation Zaurus::rotation() const | 489 | Transformation Zaurus::rotation() const |
518 | { | 490 | { |